Skip to content

Repository files navigation

Full Width Characters Converter

Full Width Characters Converter is a browser-based text conversion tool for changing letters, numbers, symbols, spaces, and Japanese Katakana between full-width and half-width forms.

The tool also detects mixed-width text, highlights convertible characters, and provides a character-level change report. All text processing runs directly in the browser.

Website: https://yeshan-jun.github.io/full-width-characters-converter/

What It Does

  • Converts full-width characters to half-width.
  • Converts half-width characters to full-width.
  • Converts letters, numbers, symbols, spaces, and Japanese Katakana independently.
  • Detects mixed full-width and half-width text as the user types.
  • Highlights convertible full-width and half-width characters.
  • Counts full-width characters, half-width characters, full-width spaces, and half-width Katakana.
  • Handles voiced and semi-voiced Katakana such as ガ, パ, , and .
  • Shows every changed character, category, and position.
  • Copies the converted result to the clipboard.
  • Preserves line breaks and unselected character categories.

How To Use

Enter Text

Paste or type text into the input editor on the left.

The Mixed Width Detector updates automatically and shows:

  • Full-width character count
  • Half-width character count
  • Full-width space count
  • Half-width Katakana count
  • Highlighted character inspection

Click Use example to load a mixed Japanese text example.

Choose Character Types

Select the character categories the converter may change:

  • Letters
  • Numbers
  • Symbols
  • Spaces
  • Katakana

Clear a category to preserve those characters in the result.

Choose A Conversion Direction

Click one of the conversion buttons:

  • Convert to Half Width
  • Convert to Full Width

The converted text appears in the output editor on the right.

Review The Result

The Change Report shows:

  • Original character
  • Converted character
  • Character category
  • Character position

This makes changes such as full-width spaces and Katakana combinations easy to review.

Copy Or Reset

Click Copy result to copy the converted text.

Click Clear to remove the current input and output.

Supported Character Types

Letters

ABCabc ↔ ABCabc

Numbers

12345 ↔ 12345

Symbols

!"#$% ↔ !"#$%

Spaces

Full-width space:  
Half-width space:

Japanese Katakana

ガッツポーズ ↔ ガッツポーズ

The converter supports half-width Katakana, small Katakana, Japanese punctuation, voiced marks, and semi-voiced marks.

Kanji and Hiragana are preserved because the converter only changes supported character-width pairs.

Technical Details

The project is built with:

  • HTML
  • CSS
  • JavaScript ES modules
  • Browser Clipboard API
  • Unicode character mapping
  • Unicode normalization for Katakana composition
  • Node.js built-in test runner
  • Python Playwright browser smoke tests

The conversion engine uses targeted character mappings instead of applying compatibility normalization to the entire input.

For Latin letters, numbers, and ASCII symbols, conversion is based on the Unicode offset between half-width ASCII and full-width forms.

For Japanese Katakana:

  • Half-width Katakana sequences are composed into full-width Katakana.
  • Full-width Katakana is converted through an explicit reverse mapping.
  • Voiced and semi-voiced combinations are handled as complete character sequences.

All conversion logic is contained in converter.js and does not require a backend service or external conversion API.

Project Structure

.
├── index.html
├── style.css
├── script.js
├── converter.js
├── favicon.svg
├── package.json
├── tests/
│   ├── converter.test.js
│   ├── html-contract.test.js
│   └── browser_smoke.py
├── .nojekyll
├── .gitignore
├── LICENSE
└── README.md

Core Files

File Purpose
index.html Defines the page structure, SEO metadata, converter controls, examples, footer, and analytics script.
style.css Provides the responsive desktop and mobile interface, editor layout, detector highlights, and component styling.
script.js Connects the page controls to the conversion engine and manages input, output, detector statistics, copy actions, and change reports.
converter.js Contains character mappings, conversion rules, mixed-width detection, highlighting data, and change-report generation.
favicon.svg Provides the website icon.
package.json Defines the project metadata and Node.js test command.
.nojekyll Configures GitHub Pages to serve the repository as a plain static website.
LICENSE Contains the MIT License.

Test Files

File Purpose
tests/converter.test.js Tests character conversion, category controls, Katakana handling, detection, and change reports.
tests/html-contract.test.js Verifies required HTML controls, SEO metadata, canonical URL, and page structure.
tests/browser_smoke.py Tests the main interaction flow in a real browser.

Deployment

This project is a static website and can be deployed without a backend.

GitHub Pages

  1. Create or open the repository:

    https://github.com/yeshan-jun/full-width-characters-converter
    
  2. Upload the project files to the repository root.

  3. Open Settings → Pages.

  4. Select Deploy from a branch.

  5. Choose the main branch.

  6. Choose the / (root) folder.

  7. Save the Pages settings.

The website will be available at:

https://yeshan-jun.github.io/full-width-characters-converter/

Local Preview

Run this command inside the project directory:

python -m http.server 8000

Then open:

http://127.0.0.1:8000/

A local web server loads the JavaScript ES modules correctly.

Other Static Hosts

The same files can also be deployed to:

  • Cloudflare Pages
  • Netlify
  • Vercel static hosting
  • Apache HTTP Server
  • Nginx
  • Caddy
  • Static object storage hosting

Repository

GitHub repository:

https://github.com/yeshan-jun/full-width-characters-converter

GitHub Pages website:

https://yeshan-jun.github.io/full-width-characters-converter/

Privacy

Full Width Characters Converter processes text locally in the browser.

The application does not require an account, backend service, database, or text-processing API. Input text remains in the current browser tab and is cleared when the page is refreshed or closed.

License

This project is released under the MIT License.