DevToolBox

Zenkaku / Hankaku Converter

全角と半角を相互変換します。英数記号・カタカナ・スペースを個別に選べます。

変換方向
変換対象

0 文字

変換結果

0 文字

How to Use the Zenkaku / Hankaku Converter

Japanese text mixes two character widths. Fullwidth (zenkaku) characters occupy the same square cell as a kanji, while halfwidth (hankaku) characters take roughly half that width. Because (U+FF21) and A (U+0041) are entirely different code points, a value typed with the wrong width fails exact-match lookups, breaks validation rules, and produces duplicate records that look identical on screen. This converter normalizes text in either direction so those mismatches disappear.

Pick a direction, tick the character classes you want to touch, then type or paste your text. Conversion happens as you type and the result can be copied with one click. Nothing is uploaded — the transformation runs entirely in your browser.

What Each Target Covers

Alphanumerics and symbols maps the fullwidth Latin block (U+FF01–U+FF5E) to plain ASCII and back, so ABC123- becomes ABC123-. Katakana converts between fullwidth katakana and the halfwidth katakana block (U+FF61–U+FF9F); voiced marks are handled correctly, so ガ (two code points) becomes the single character and vice versa. Space switches the ideographic space U+3000 and the ordinary ASCII space U+0020. Keeping these independent matters: a common requirement is to normalize alphanumerics while deliberately leaving katakana untouched.

Typical Use Cases

Normalizing form input before saving it to a database is the most common one — phone numbers, postal codes, and email addresses are frequently typed in fullwidth by users on Japanese IME. Cleaning legacy CSV exports from older systems that stored halfwidth katakana is another. Developers also use it to sanitize search keys so that a query for ABC matches a record stored as ABC.

全角・半角変換ツールの使い方

変換方向(全角→半角 / 半角→全角)を選び、変換したい対象(英数字・記号 / カタカナ / スペース)に チェックを入れてテキストを入力してください。入力と同時に変換され、結果は「コピー」ボタンで クリップボードに取得できます。処理はすべてブラウザ内で完結し、入力内容が外部に送信されることは ありません。

対象を個別に切り替えられるのがポイントです。たとえば「英数字だけを半角に統一したいが、 カタカナは全角のまま残したい」という住所・氏名の正規化でよく使う組み合わせにも対応できます。

よくある落とし穴と対処 / Common Pitfalls

落とし穴 / Pitfall問題 / Problem対処 / Fix
半角カナの濁点は2文字
Halfwidth voiced kana is two code points
ガ は カ + ゙ の2文字。length で数えると想定とズレ、1文字ずつ切ると濁点が外れる
Splitting per code unit detaches the voiced mark
全角カタカナに正規化してから文字数を数える・切り出す
Normalize to fullwidth before counting or slicing
DB照合順序に頼る
Relying on DB collation
照合順序によっては全角/半角を同一視するものとしないものがあり、環境差で検索結果が変わる
Width-insensitive collation is not universal
保存前にアプリ側で正規化して、DB設定に依存しない
Normalize in the application before insert
一括で全部半角にする
Blanket conversion to halfwidth
氏名のカタカナまで半角になり、帳票や郵送物の見栄えが崩れる
Names become halfwidth katakana and look broken in print
対象を分けて、英数字だけ半角・カナは全角に寄せる
Convert classes separately
全角スペースの見落とし
Overlooking U+3000
trim() は U+3000 も除去するが、split(" ") や正規表現の \\s 指定漏れで区切れないことがある
Naive space splitting misses the ideographic space
スペースも変換対象に含めて事前に統一する
Normalize spaces up front
円記号とバックスラッシュ
Yen sign vs backslash
全角¥(U+FFE5)を半角にすると環境により \\ になり、パス文字列で事故る
Fullwidth yen can map to a backslash
通貨記号を含むデータは変換後に目視確認する
Review currency symbols after converting

言語別コード例 / Code Examples

JavaScript

// 英数記号の全角 → 半角(Unicode正規化を使う簡易版)
const toHankaku = (s) => s.normalize("NFKC");

// NFKC は半角カナも全角カタカナに寄せる点に注意
"ABC ガ".normalize("NFKC"); // => "ABC ガ"

Python

import unicodedata
# 全角英数 → 半角、半角カナ → 全角カナ をまとめて行う
unicodedata.normalize("NFKC", "ABC ガ")  # => "ABC ガ"

NFKC は手軽ですが「英数字だけ」「カタカナだけ」といった細かい選択ができません。 対象を分けたい場合は本ツールのように種類ごとに処理を分ける必要があります。

変換例 / Before & After

入力: DevToolBox 123-ABC
→ 全角→半角(英数記号+スペース): DevToolBox 123-ABC

入力: デバッグ用サンプル
→ 半角→全角(カタカナ):          デバッグ用サンプル

入力: ABC カタカナ
→ 全角→半角(英数記号のみ):      ABC カタカナ   ← カナは変換しない

Why browser-only?

The text you normalize is often personal data — names, addresses, phone numbers pulled from a form or a customer export. This converter runs the transformation locally with plain string operations: nothing is uploaded, nothing is logged, and it works offline. Open the DevTools Network tab while converting and you will see zero requests.

正規化にかけるのは氏名・住所・電話番号といった個人情報であることが多い処理です。 本ツールは変換がブラウザ内で完結し、外部送信は一切ありません。