Shift-JIS is a long-standing Japanese character encoding; in practice most files labelled Shift-JIS use the Windows code page CP932. It mixes one-byte and two-byte characters in a single stream. This tool encodes Japanese text into Shift-JIS hex bytes and decodes Shift-JIS hex back into text.
How it works
ASCII and half-width katakana occupy a single byte. Every other character —
kanji, hiragana, full-width katakana, full-width punctuation — is two bytes: a
lead byte in 0x81–0x9F or 0xE0–0xFC, followed by a trail byte in
0x40–0xFC (skipping 0x7F). A decoder distinguishes the two cases by
inspecting whether the current byte falls in a lead-byte range.
To stay faithful to the real CP932 table, the tool enumerates every valid single byte and lead/trail pair, decodes each with the browser’s native Shift-JIS decoder, and records the resulting character-to-bytes mapping. Encoding looks each character up in that map; decoding runs the hex bytes through the native decoder directly.
Example and notes
"日本語"encodes to93 fa 96 7b 8c ea— three kanji, each a two-byte pair.- Because a trail byte can fall in the ASCII range (
0x40–0x7E), naive byte-by-byte processing of Shift-JIS can misread text; always decode using the lead/trail rules, as this tool does. - Shift-JIS predates emoji and many rare kanji, so modern symbols will be flagged as unmapped. Use UTF-8 when you need the full Unicode range.