BOM(バイトオーダーマーク)

BOM

Encoding & Standards

UTF-16/UTF-32エンコーディングでバイト順序(エンディアン)を示すためにテキストファイルの先頭に置かれる文字(U+FEFF)。

The BOM is a special Unicode character used to signal the byte order of a text stream. In UTF-16, it distinguishes between little-endian (FF FE) and big-endian (FE FF) formats.

In UTF-8, a BOM (EF BB BF) is sometimes added but is not recommended — it can cause issues with scripts, JSON parsing, and Unix tools that don't expect it. Many text editors add a UTF-8 BOM by default, which can lead to subtle bugs.

Modern best practice: use UTF-8 without BOM for web content and data files.

関連用語

UTF-16 UTF-16
1文字あたり2または4バイトを使用する可変長Unicode符号化方式。JavaScript、Java、Windowsが内部的に使用している。
UTF-32 UTF-32
1文字あたり正確に4バイトを使用する固定長Unicode符号化方式。コードポイントへの直接マッピングが可能だが、ストレージ効率が低い。
UTF-8 UTF-8
1文字あたり1〜4バイトを使用する可変長Unicode符号化方式。ウェブで最も普及しており、98%以上のウェブサイトで使用されている。

関連ツール

🔢 Unicode 検索 Unicode 検索
U+1F600 のようなコードポイントを入力すると、対応する絵文字、エンコード詳細、UTF-8/16 バイト、HTML エンティティを確認できます。