HTML encoder

Type or paste text to escape it for HTML. & and < become &amp; and &lt;, and quotes are escaped too so the result is safe inside an attribute. Choose + non-ASCII to write accents and emoji as numeric references for pure-ASCII output.

Encode a file:

Which characters to escape, and where

Inside HTML, & and < must always be escaped as &amp; and &lt;, and inside an attribute value the quote that wraps it must be escaped too. The Text + attrs variant escapes all five (& < > " '), which is safe in both places and is what server-side escapers do. Measured on Tom's <b>"A&B"</b>:

Text only leaves quotes as they are, which is fine between tags but unsafe inside an attribute. JavaScript has no built-in escaper: setting textContent instead of innerHTML avoids the need for one.

Why decoded URLs turn into © and ¬

An unescaped & in a URL is the classic decoding surprise. HTML recognizes some old entities even without the closing semicolon, so in page text ?id=1&copy=2&lang=en&not=3 is read as ?id=1©=2&lang=en¬=3. Measured in Chromium: the same string in an href attribute is kept as it is, but as text it gets the © and ¬. Python's html.unescape() gives ©=2 too; PHP's html_entity_decode() leaves it alone. This decoder works like page text and warns when a &name= was swallowed, so you can tell a URL from escaped text. In your HTML, write such URLs with &amp;.

Other decoding pitfalls

Decoding runs in your browser and never runs scripts: <script> or onerror in the input stays plain text.

Render HTML to a PDF or an image

Shotmint is a screenshot and PDF API. POST https://shotmint.creasework.com/v1/pdf with {"html": "…"} returns a PDF, and /v1/screenshot returns a PNG of any URL or HTML, rendered in real Chromium (1 credit each; 25 free renders a month, then €5 for 2,000 that never expire). Add response=url to get a link instead of the bytes, or put the URL in a query string with the encoding above. Scripts, AI agents and Make or Zapier can get a key with a bare POST https://shotmint.creasework.com/v1/keys/free (no body, JSON reply); request bodies are described in openapi.json.

Get 25 free renders a month API docs

FAQ

Is my text uploaded? No. Encoding and decoding run in your browser and nothing is sent to a server, so tokens, API keys and private data stay on your device.

Is Base64 encryption? No. Anyone can decode it; it only turns bytes into text that survives email, JSON and URLs, and makes the data about 33% bigger.

Related tools: Base64 encoder, Base64 decoder, JWT decoder, URL encoder, URL decoder, Text to hex converter, Hex to text converter, HTML entity decoder, JSON formatter, Image to Base64, Base64 to image.

Related tools

Base64 Encode · URL Encode · PDF to HTML · HTML to image · HTML to PDF · HTML formatter · Word to HTML · HTML to Markdown · HTML to Word · Markdown to HTML · Online HTML editor · HTML viewer · HTML Decode · HTML Minifier · HTML Beautifier · HTML to DOCX · HTML to JPG Converter · HTML to PNG Converter · all free tools