URL Encoder & HTML Entity Encoder
Percent encode text for safe use in URLs, or convert HTML special characters like <, >, and & into their entity equivalents. Both operations run entirely in your browser using native JavaScript functions.
How to Use
- Choose a mode. Select the URL tab for percent encoding or the HTML Entities tab for HTML character escaping
- Set the direction. Pick Encode or Decode
- For URL encoding, choose Component (encodes everything for use as a query value) or Full URI (preserves URL structure characters)
- Paste or type your text. The output updates instantly
- Use Swap to reverse the operation. It takes the output, flips the direction, and processes again
URL Percent Encoding
Every byte in a URL that falls outside the unreserved character set (letters, digits, -, _, ., ~) gets replaced with % followed by two uppercase hex digits. This is defined in RFC 3986 and is how browsers transmit query parameters, path segments, and fragment identifiers that contain spaces, Unicode, or reserved delimiters.
The two modes reflect JavaScript’s two native functions. encodeURIComponent is what you want almost every time. It encodes a single value so it can be safely embedded as a query parameter or path segment. encodeURI is for encoding a complete URL string while preserving its structural characters (://, /, ?, #, &, =). Using encodeURI on a query value that contains & or = will silently corrupt your URL.
HTML Entity Encoding
HTML reserves five characters for its own syntax: &, <, >, ", and '. If these appear in user supplied content rendered into HTML without encoding, the browser interprets them as markup, which is how reflected XSS attacks work. Entity encoding replaces each character with a safe reference (&, <, >, ", ') that the browser renders as the literal character.
This tool encodes those five characters using named entities where available and numeric entities as a fallback. When decoding, it handles named entities, decimal (<), and hexadecimal (<) forms.
Need to encode binary data as text? Try Base64 Encode/Decode. Working with tokens that contain encoded payloads? The JWT Decoder handles Base64URL automatically.