Skip to content
All tools
EncodingRuns locallyNo account

HTML entity decoder

Decode named, decimal, and hexadecimal HTML entities back to text - including the mixed-form entities used to slip past XSS filters.

Open in ctfpal

HTML entities exist so that < can appear in a document without starting a tag. They come in three forms - named (&lt;), decimal (&#60;), and hexadecimal (&#x3c;) - and browsers accept sloppy variants of all three, including entities with leading zeroes and entities with no trailing semicolon.

Why the sloppy forms matter

That tolerance is the whole game in filter-bypass challenges. A filter looking for the literal string javascript: does not match &#106;avascript:, but the browser resolves the entity before parsing the URL and navigates anyway. Decoding a payload through every accepted form is how you work out which layer was fooled.

  • &#0000106; - leading zeroes are permitted and unlimited.
  • &#106 - the semicolon is optional in attribute contexts.
  • &#x6a; and &#X6A; - hexadecimal, either case.
  • Entities nested inside percent-encoding, which needs URL decoding first.

Worked example

Entity-obfuscated payload

Input

&#x3c;img src=x onerror=&#97;lert(1)&#x3e;

Result

<img src=x onerror=alert(1)>

Mixed hex and decimal entities in the same string - each one decodes independently.

Load this example in the workspace

Related tools