Japanese Encoding Lookup & Mojibake Fixer

Share:

Fix Japanese mojibake (文字化け) and look up any character's Shift_JIS, EUC-JP, ISO-2022-JP, UTF-8 and JIS codes.

RT-DEV-098 · Developer Tools

Japanese Encoding Lookup & Mojibake Fixer

Fix mojibake

Paste text that came out garbled. The tool works out which encoding it really was.
Try:

Paste garbled text above, or pick an example.

Look up characters

Every byte form of each character, and whether it survives the trip.
Char Unicode Shift_JIS EUC-JP ISO-2022-JP UTF-8 JIS · 区点 Set
📅 Research current as of 02 Oct 2026 · Sources: WHATWG Encoding Standard §12 (Shift_JIS, EUC-JP and ISO-2022-JP decoders and encoders) and its index files index-jis0208, index-windows-1252 and index-iso-2022-jp-katakana, from which the page's tables are generated; the generated file records each index's published SHA-256 identifier. Cross-checked against Chrome 152's TextDecoder over every one- and two-byte sequence: 0 mismatches. Compared with the unicode.org mapping files on 2 Oct 2026: the table matches Microsoft's CP932.TXT on every two-byte code and differs from Unicode's JIS0208.TXT at seven positions, including 81 60.
Standards, published formulas, and reference data are revised over time — check against a current authoritative source before relying on these figures.

Everything runs in your browser — nothing you paste is sent anywhere. The codecs are the ones your browser itself uses, from the web's Encoding Standard, except EUC-JP's rare three-byte JIS X 0212 form, which is shown as unknown.

Advertisement

How to use the Japanese encoding tool

1
Paste the garbled text

Copy it exactly as it appears — the accented Latin letters, the strange kanji, the half-width katakana and the � marks all matter, because they are the evidence of which encodings were mixed up.

2
Read the candidates

Each candidate names a mix-up — for example "UTF-8 shown as Windows-1252" — and shows the text it gives back. Pick the one that reads as real Japanese; the best-scoring one is listed first.

3
Check what was lost

A □ marks a place where the wrong decoding had already destroyed bytes. The tool never fills those gaps with a guess. If the source file still exists, open it again with the right encoding instead.

4
Look up single characters

Type characters into the lower box to see their bytes in every Japanese encoding, their JIS code and 区点 position, and whether the character survives a round trip.

Why Japanese text turns into mojibake, and what can be recovered

Japanese has had more competing text encodings than almost any other language, and mojibake (文字化け, "character transformation") is the word for what happens when text written in one is read as another. Three legacy encodings did most of the damage. Shift_JIS was designed so that Japanese could live alongside the single-byte katakana of early computers, and it became the default on Windows. EUC-JP fitted Japanese into the conventions of Unix systems. ISO-2022-JP, with escape sequences that switch between ASCII and Japanese, was the standard for email. All three encode the same core character set, JIS X 0208, but they arrange its bytes differently — so a file saved in one and opened in another becomes nonsense.

Every mix-up leaves a signature

The garbage is not random. UTF-8 read as Windows-1252 turns 文字 into strings like 文字 — accented Latin letters in threes, one per UTF-8 byte. UTF-8 read as Shift_JIS produces unfamiliar kanji broken up by � marks. EUC-JP read as Shift_JIS comes out as a soup of half-width katakana, because most EUC-JP bytes happen to fall in Shift_JIS's half-width range. This tool uses those signatures: it re-creates the bytes the wrong decoder must have seen, decodes them the right way, and ranks the results by how much they read like Japanese — hiragana and common kanji count in favour, the debris of a wrong decoding counts against.

Some mojibake can be undone exactly and some cannot. When a decoder has already replaced bytes with �, those bytes are gone, and an honest repair shows the gap instead of guessing what filled it.

Recoverable and unrecoverable

Whether a repair is possible depends on the direction of the mistake. UTF-8 shown as Windows-1252, or Shift_JIS shown as Windows-1252, is lossless: every byte survives as some Latin character, and the original comes back perfectly. UTF-8 shown as Shift_JIS is partly destructive — some byte pairs land on unassigned codes and are replaced with �, taking a character on each side with them. Encode 文字化け in UTF-8, read it as Shift_JIS, and only 化 can be recovered; the tool shows □化□ rather than pretending. Shift_JIS shown as UTF-8 is the worst case: nearly every byte becomes �. If you still have the original file, reopening it with the right encoding always beats repairing the damaged copy.

The characters that break even when nothing is mixed up

A few characters misbehave inside a single encoding. Browsers and Windows read the Shift_JIS byte 5C as a backslash, but Japanese fonts draw it as a yen sign — which is why Windows paths appear as C:¥ in Japan — and the web standard writes the yen sign itself as that same byte, so a ¥ sent out comes back as \. Not every decoder reads 5C that way: Python's shift_jis_2004 and macOS iconv's SHIFT_JIS return ¥.

The wave dash 〜 (U+301C) depends on the table. The WHATWG Encoding Standard that browsers follow maps Shift_JIS 81 60 to the full-width tilde ~ (U+FF5E), exactly as Microsoft's CP932 table does, and neither has a code for 〜. Unicode's own JIS X 0208 mapping, and converters that follow JIS, map 81 60 to 〜 instead. The same two bytes come back as different characters depending on which program reads them, and that disagreement is the "wave dash problem".

Characters such as ① and 髙 are vendor additions rather than part of JIS X 0208: the kind Japanese software calls 機種依存文字 ("machine-dependent characters") or 環境依存文字.

One name, several tables

"Shift_JIS" does not name a single table. On 2 Oct 2026 we decoded every two-byte code the browser defines with other converters. Microsoft's CP932 table agreed with the browser on every one. Unicode's JIS X 0208 mapping disagreed at seven positions, the wave dash among them. A strict Shift_JIS converter (Python's shift_jis, macOS iconv's SHIFT_JIS) rejected all 845 vendor codes. And a JIS X 0213 converter (Python's shift_jis_2004, macOS iconv's SHIFT_JISX0213) read all 373 characters of IBM's extension set (360 of them kanji) as other kanji, with no error: 髙 (FB FC) became 騠. Those are the IBM codes FA 40 to FC 4B that a browser writes; the NEC-selected copies of the same characters (lead bytes ED and EE) were misread too, so the result holds for both forms. A file can be "Shift_JIS" to the program that wrote it and to the program that read it, and still change on the way. When you convert a file written on Windows, name the table: CP932, also called Windows-31J.

Advertisement

A byte that is both ¥ and \, a dash two tables disagree on, and a kanji with two sets of bytes

01

Browsers and Windows read the Shift_JIS byte 5C as a backslash, but Japanese fonts draw it as ¥, which is why Windows file paths appear as C:¥ in Japan. Python's shift_jis_2004 and macOS iconv's SHIFT_JIS decode 5C as ¥ outright.

02

The web's Encoding Standard writes the yen sign U+00A5 as that same byte 5C, so a ¥ sent out in Shift_JIS comes back as a backslash.

03

Shift_JIS 81 60 is U+FF5E FULLWIDTH TILDE in the WHATWG table browsers use and in Microsoft's CP932, and neither has a code for the WAVE DASH U+301C. Unicode's JIS X 0208 mapping, and converters that follow JIS, put U+301C at 81 60 instead.

04

The standard's JIS X 0208 table has 7,724 entries but only 7,326 distinct characters, because vendor extensions repeat characters that are already there.

05

The Shift_JIS encoder deliberately skips one block of those duplicates, so 髙 is written with the IBM bytes FB FC — while EUC-JP writes the same character as FC E2.

06

JIS X 0208 splits its kanji into level 1, 2,965 common characters, and level 2, 3,390 rarer ones.

07

① and the other 82 characters in JIS row 13 are an NEC addition, not part of JIS X 0208, and one source of what Japanese software calls 機種依存文字 or 環境依存文字.

08

Shift_JIS F0 40 to F9 FC decode to the Private Use characters U+E000 to U+E757, Windows' user-defined characters. The web standard will not encode them back; Microsoft's bestfit932 table maps them back to the same bytes.

09

ISO-2022-JP wraps every run of Japanese in the escapes ESC $ B and ESC ( B, and converts half-width katakana to full-width because it cannot carry them.

10

Encode 文字化け in UTF-8 and read it as Shift_JIS, and the bytes of 文 and 字 are destroyed: only 化 can be recovered.

Frequently asked questions

  • Mojibake (文字化け) is garbled text produced when bytes written in one character encoding are read as another — for example a UTF-8 file opened as Shift_JIS. The characters on screen are real characters, just the wrong ones, which is why the damage can often be reversed.

  • No. If the wrong decoder turned bytes into the replacement character �, those bytes no longer exist anywhere in the text. The tool recovers every character whose bytes survived and marks each lost place with □. If you still have the original file, reopen it with the right encoding instead.

  • It tries every combination of UTF-8, Shift_JIS, EUC-JP and Windows-1252: it re-creates the bytes the wrong decoder must have read, decodes them with each other encoding, and scores the results by how much they read like Japanese. The best three are shown, each labelled with the mix-up it assumes.

  • That is UTF-8 read as Windows-1252 (or ISO-8859-1): each Japanese character is three UTF-8 bytes, and each byte became one Latin character. It is fully recoverable as long as nothing stripped the invisible control characters some of those bytes become; once they are gone, an exact repair is no longer possible. Paste it into the tool.

  • Because in Shift_JIS both are the byte 5C. Browsers and Windows decode 5C as a backslash, Japanese fonts draw it as a yen sign, and the Encoding Standard writes ¥ as 5C. So a ¥ encoded in Shift_JIS and decoded again in a browser comes back as \. Not every decoder agrees: Python's shift_jis_2004 and macOS iconv's SHIFT_JIS read 5C as ¥.

  • Because two published tables disagree about Shift_JIS 81 60. The WHATWG Encoding Standard, which browsers follow, and Microsoft's CP932 table map it to U+FF5E FULLWIDTH TILDE and have no code for U+301C WAVE DASH, so a browser cannot write 〜 in Shift_JIS, EUC-JP or ISO-2022-JP. Unicode's JIS X 0208 mapping and converters that follow JIS map 81 60 to U+301C. Text that crosses from one to the other comes back as the other character, or is refused. This is the long-running "wave dash problem".

  • Machine-dependent characters: symbols and kanji such as ①, Ⅰ and 髙 that were added by vendors like NEC and IBM rather than defined in JIS X 0208. Browsers and Windows carry them, but a strict Shift_JIS converter rejects their bytes, and a JIS X 0213 (2004) converter reads all 373 characters of IBM's extension set (360 of them kanji) as other kanji, with no error: 髙, Shift_JIS FB FC, becomes 騠. The lookup table labels them.

  • The row and cell number of a character in the JIS X 0208 grid of 94 × 94 positions. 亜 is 16-01: row 16, cell 1. The JIS code is the same position as two bytes — 亜 is 3021 — and Shift_JIS and EUC-JP are both calculated from it.

  • No. It uses exactly the tables browsers use, from the WHATWG Encoding Standard, which is based on JIS X 0208 with vendor extensions. Characters only in JIS X 0213 are reported as not encodable, and EUC-JP's three-byte JIS X 0212 form is decoded as unknown.

  • No. The encoding tables and the repair logic run in your browser; the tool makes no network request with your text and stores nothing.

Method & sources

How it computes

Encoders and decoders transcribed from the WHATWG Encoding Standard §12 (Shift_JIS, EUC-JP, ISO-2022-JP) over index-jis0208, index-windows-1252 and index-iso-2022-jp-katakana. Mojibake repair re-encodes the text with each candidate wrong decoder and decodes it with each right one (UTF-8, Shift_JIS, EUC-JP, Windows-1252), marks bytes the wrong decoder destroyed, and ranks results by a per-character Japanese-text score.

What this tool implements

  • The codecs follow the WHATWG Encoding Standard §12 step by step — the algorithms every browser runs — so the page agrees with what a browser does with the same bytes. Cross-checked against Chrome 152's TextDecoder on 2026-09-27 over every one- and two-byte sequence (65,792 per codec) for Shift_JIS, EUC-JP and Windows-1252: 0 mismatches.
  • Compared on 2026-10-02 with the unicode.org mapping files: the WHATWG table matches Microsoft's CP932.TXT on all 7,724 two-byte codes and differs from Unicode's JIS0208.TXT at 7 positions (81 5F, 81 60, 81 61, 81 7C, 81 91, 81 92, 81 CA). The page states which table it uses wherever the two disagree.
  • ⚠️ The standard's choices are shown, not smoothed over: U+00A5 ¥ encodes to 5C and browser and Windows decoders read 5C as a backslash (Python shift_jis_2004 and macOS iconv SHIFT_JIS read ¥); U+301C WAVE DASH has no code in index jis0208, while Unicode's JIS0208.TXT and JIS-faithful converters map it to 81 60; U+2212 MINUS SIGN is replaced by U+FF0D before encoding; the Shift_JIS encoder skips pointers 8272-8835 and so writes 髙 as FB FC (IBM) while EUC-JP writes FC E2 (NEC), bytes Python euc_jp and iconv EUC-JP reject and EUC-JIS-2004 reads as 郄.
  • JIS X 0212 (EUC-JP's three-byte 8F form) and JIS X 0213 are not covered, and the page says so. Measured on 2026-10-02: JIS X 0213 decoders (Python shift_jis_2004, macOS iconv SHIFT_JISX0213) read all 373 characters of IBM's extension set (360 of them kanji) as other kanji, with no error (髙 FB FC → 騠), and the page warns on each.

Sources

Abridged — the full review record for this tool runs longer than the list above.

Advertisement
Pre-footer · AD-W3 728 × 90