HTML Entity Encoder & Decoder
Escape text for safe use inside HTML, encode every non-ASCII character as a numeric entity, or decode named and numeric entities back to text.
Runs on your device
Result
Results appear here as you type.
What it does
Showing code samples in a blog post or putting user text into a template requires escaping & < > " and '. This tool does that, and it can also decode entity heavy text copied from page sources.
How to use it
- Pick encode, encode all non-ASCII, or decode.
- Paste your text.
- Copy the result.
Example
The example fills in realistic values and runs the tool. Select Try an example above to see it.
When it helps
- Publishing code snippets in HTML.
- Cleaning scraped text full of &nbsp;.
- Preparing strings for XML or email templates.
Questions
Is escaping enough to prevent XSS?
It is correct for text placed between tags and inside quoted attributes. JavaScript, URL and CSS contexts need their own encoding.
Which named entities are decoded?
The common ones (amp, lt, gt, quot, apos, nbsp, copy, reg, trade, hellip, dashes and currency signs) plus every numeric entity.
More developer tools
See all 25- Cron Expression Explainer Translate a five field cron expression into plain English and list its next scheduled run times in your local time zone.
- Number Base Converter Convert integers of any size between binary, octal, decimal, hexadecimal and base 36 using exact BigInt arithmetic.
- JSON to TypeScript Interfaces Generate TypeScript interfaces from a sample JSON payload, with nested types, optional properties inferred from arrays, and safe property names.
- IPv4 Subnet Calculator (CIDR) Calculate network address, broadcast, usable host range, subnet mask, wildcard mask and host count from any IPv4 address and CIDR prefix.
- Chmod Calculator (Linux Permissions) Convert Linux file permissions between octal (755) and symbolic (rwxr-xr-x) notation and see exactly who can read, write and execute.
- YAML ⇄ JSON Converter Convert YAML to JSON and JSON to YAML for Kubernetes manifests, GitHub Actions, Docker Compose and config files, with clear parse errors.
People also use
Browse all 200 tools- PDF Metadata Viewer & Editor View a PDF’s title, author, creator software and dates, then edit or clear them before you share the file. PDF
- Frequency to Wavelength Calculator Convert frequency to wavelength (λ = v/f) for radio, microwave and transmission lines, with velocity factor, half wave and quarter wave antenna lengths. Electrical & engineering
- Webcam Test Check your webcam online with a live preview, camera selection, resolution and frame rate readout, and a snapshot you can download. Device tests
- Rotate & Flip Image Rotate an image by 90, 180 or 270 degrees and flip it horizontally or vertically. Also fixes sideways phone photos by applying EXIF orientation. Image