HTMLエンティティ エンコード&デコード
HTMLの特殊記号や予約文字(<, >, &, " など)を数値参照・名前付きエンティティへ安全に変換。
使い方・操作ガイド HTMLエンティティ エンコード&デコード
1. データの入力または貼り付け
コードやテキスト、ペイロードを直接エディタに入力または貼り付けます。
2. ブラウザ内での即時高速処理
サーバーとの通信を行わず、ローカルのブラウザメモリ内で瞬時に検証・変換が行われます。
3. 結果のコピーまたは保存
変換・整形されたデータをワンクリックでクリップボードにコピーまたはファイル保存します。
このツールの仕組み
XSS対策やWebページ制作に必要なHTMLエンティティ変換ツール。名前付き文字実体参照と16進数/10進数コードポイントに完全対応。
JSONペイロードやコードは完全にローカル環境で処理されます。外部サーバーへのデータ送信は一切ありません。
よくある質問
Why should I encode HTML special characters?
Characters like <, >, and & can be interpreted as HTML tags or scripts by browsers. Converting them to entities ensures they are safely displayed as raw text without risking Cross-Site Scripting (XSS).
What is the difference between named, decimal, and hex entities?
Named entities (like &) use mnemonic names, decimal entities (like &) use ASCII/Unicode integer codes, and hex entities (like &) use hexadecimal numbers. All three render identically in modern web browsers.
Escape & Encode HTML Entities in Shell
重い外部パッケージを導入せず、ターミナル上で直接実行可能
$ python3 -c 'import html, sys; print(html.escape(sys.argv[1]))' "<script>alert(1)</script>"Escapes &, <, >, ", and ' characters into safe HTML entities.
$ node -e 'console.log(process.argv[1].replace(/[&<>"\']/g, m => ({"&":"&","<":"<",">":">","\"":""","\'":"'"}[m])))' "<script>"One-liner to escape vulnerable HTML characters into sanitised entities.