MyToolsKart

HTML Encode / Decode

Escape special characters into HTML entities (or decode them back) so your text displays safely in web pages. Runs in your browser.

Text / HTML
Encoded

Why encode HTML?

A handful of characters have special meaning in HTML: the angle brackets< and > start and end tags, &begins an entity, and quotes wrap attributes. If you display user-supplied text that contains those characters without escaping them, the browser may treat it as markup — breaking your page layout or, worse, letting an attacker inject a script (a cross-site scripting, or XSS, vulnerability). Encoding replaces those characters with safe entity codes so the text shows literally.

How to encode or decode

  1. Choose Encode (text → entities) or Decode (entities → text).
  2. Paste your content.
  3. Copy the result.

An example

The snippet <b>Hi & bye</b> encodes to&lt;b&gt;Hi &amp; bye&lt;/b&gt;, which displays as the literal text rather than being rendered as bold HTML.

Frequently asked questions

Which characters are escaped? The five core ones: &, <, >, " and apostrophe. Decoding handles all named and numeric entities.

Is encoding enough to prevent XSS? Escaping output is a key defence, but a full XSS strategy also depends on context (HTML, attributes, JavaScript, URLs). Use it as part of a broader approach.

Is it private? Yes — everything runs in your browser.