DevToolBox

Hex Dump Viewer

テキストをUTF-8バイト列に変換し、オフセット・16進数・ASCIIの3列でダンプ表示します。

0 bytes(0 文字 / 全 0 行 / 16 bytes per line)
テキストを入力するとダンプ結果がここに表示されます

How to Use the Hex Dump Viewer

This free online hex dump viewer converts any text into its UTF-8 byte representation and displays it in the classic three-column layout used by tools like xxd -C and hexdump -C: an 8-digit hexadecimal offset, 16 hex byte values per line (split into two groups of 8), and an ASCII column where unprintable or non-ASCII bytes are shown as .. Just type or paste text and the dump updates instantly — no file upload required.

Features

  • Standard 16-bytes-per-line layout with an 8-byte visual gap, matching xxd -C output
  • Live UTF-8 byte count and line count as you type
  • One-click copy of the full dump as plain text, ready to paste into a bug report or terminal
  • ASCII column renders printable bytes (0x20–0x7E) and replaces everything else with .
  • Runs entirely client-side with TextEncoder — nothing is uploaded

What Is a Hex Dump?

A hex dump is a byte-level view of data, used to inspect the exact bytes that make up a file or a piece of text — useful when you need to see past what your text editor renders and confirm what is actually stored. Each line covers 16 consecutive bytes: the offset says where those bytes start (in hex), the hex column shows each byte's value from 00 to FF, and the ASCII column shows a printable interpretation side by side, so you can cross-reference a byte value with the character it represents.

Hex Dump Viewerの使い方

入力欄にテキストを入力すると、UTF-8バイト列に変換した上で、xxd -C hexdump -C と同じ形式のダンプが即座に表示されます。1行につき16バイトを「オフセット(8桁16進数) / 16進数(8バイトごとに空白区切り) / ASCII表現」の3列で並べ、表示できないバイトはASCII列で「.」に置き換えます。上部にはUTF-8バイト数・文字数・行数がリアルタイムで表示され、「コピー」ボタンで結果をテキストとして丸ごと取得できます。

実務での活用例

1. 文字コード・改行コードの実体確認

「見た目は同じなのに文字化けする」というトラブルは、実際のバイト列を見ると原因が一目で分かることが多いです。改行が 0A(LF)なのか 0D 0A(CRLF)なのか、BOM(EF BB BF)が付いているかなどを本ツールで直接確認できます。改行コードの違いについてはCRLFとLFの違いのガイドも参考にしてください。

2. マルチバイト文字のバイト構成をデバッグ

日本語1文字が何バイトになるか、絵文字がサロゲートペア相当で何バイト消費するかを、実際のUTF-8バイト列として確認できます。API仕様のバイト数制限(例: 140バイト制限のようなシステム)に収まるかの検証にも便利です。

3. コピー&ペースト時の不可視文字の混入調査

Webページや他のツールからコピーしたテキストに、見た目では分からないゼロ幅スペースや制御文字が混入していないかを確認できます。不可視文字の詳細な検出にはUnicode Inspectorも合わせて使うと、コードポイント単位でより詳しく調査できます。

よくあるエラーと対処 / Common Errors and Fixes

hex dump表示でつまずきやすいポイントをまとめました。

Common points of confusion when reading a hex dump, and how to resolve them.

症状 / Symptom原因 / Cause対処 / Fix
1文字なのにASCII列が複数の「.」になる
One character shows as several dots
UTF-8ではASCII範囲外の文字は複数バイトで構成される
Non-ASCII characters are multi-byte in UTF-8
仕様どおり。日本語は通常3バイト、絵文字は4バイト
Expected — Japanese is typically 3 bytes, emoji 4 bytes
期待したバイト数と合わない
Byte count differs from expectations
文字数(length)とUTF-8バイト数は別物
Character count and UTF-8 byte count are different measures
上部のbytes表示(UTF-8基準)を確認する
Check the "bytes" figure, which is UTF-8-based
末尾行の16進数列が短く見える
The last line's hex column looks shorter
入力の総バイト数が16の倍数でない
Total byte count is not a multiple of 16
仕様どおり。余った桁は空白で埋めて列を揃えている
Expected — remaining slots are padded with spaces to keep columns aligned
ファイル(バイナリ)を直接ダンプしたい
Want to dump a binary file, not text
本ツールはテキスト入力(UTF-8)専用
This tool only accepts UTF-8 text input
バイナリファイルはOS付属の xxd / certutil 等を使用
Use OS tools like xxd or certutil for raw binary files

言語別コード例 / Code Examples by Language

同等のhex dumpをコードやコマンドラインで再現する例です。

Minimal snippets and commands to produce the same hex dump elsewhere.

JavaScript

const bytes = new TextEncoder().encode(text);
const hex = Array.from(bytes)
  .map((b) => b.toString(16).padStart(2, "0").toUpperCase())
  .join(" ");

Python

data = text.encode("utf-8")
for i in range(0, len(data), 16):
    chunk = data[i:i+16]
    hex_part = " ".join(f"{b:02X}" for b in chunk)
    ascii_part = "".join(chr(b) if 0x20 <= b <= 0x7e else "." for b in chunk)
    print(f"{i:08X}  {hex_part:<47}  |{ascii_part}|")

Shell (xxd / hexdump)

# ファイルをダンプ / Dump a file
xxd -C input.bin
hexdump -C input.bin

# 標準入力から / From stdin
printf 'Hello' | xxd -C

Before / After 実例 / Before & After

例: 短い英文をダンプ / Dump a short sentence

Hello!

00000000  48 65 6C 6C 6F 21                                |Hello!|

6バイトすべてがASCII印字可能文字のため、ASCII列にそのまま文字が表示される。

All 6 bytes are printable ASCII, so the ASCII column shows the characters directly.

Why browser-only? / なぜブラウザ完結か

Text that gets hex-dumped for debugging is often sensitive by nature — session tokens suspected of encoding issues, raw protocol payloads, or log lines pulled straight from a production system. This tool encodes text to bytes with the browser's built-in TextEncoder and renders the dump locally; nothing is sent to a server. You can confirm this yourself in DevTools → Network — the tab stays empty while you type and copy dumps, and the page keeps working offline once loaded.

hex dump表示にかける文字列は、文字化けを疑われるセッショントークンや、実際の通信ペイロード、本番システムから取り出したログなど、機密性が高いことが珍しくありません。本ツールはブラウザ標準の TextEncoder でバイト列に変換し、ダンプ結果の描画もすべてローカルで完結します。DevToolsのNetworkタブが空のままであることで、誰でもその場で検証できます。

開発をもっと効率的に

PR