URL Encoder & Decoder

Encode special characters for safe use in URLs, or decode percent-encoded strings back to plain text.

Mode:

What is URL Encoding?

URL encoding, formally known as percent encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). Certain characters have special meaning in URLs — for example, ? starts a query string, & separates parameters, and = assigns values. If your data contains these characters, they must be encoded so the URL is not misinterpreted.

Encoding replaces each unsafe character with a % followed by two hexadecimal digits. A space becomes %20, & becomes %26, and Chinese characters like 你好 become %E4%BD%A0%E5%A5%BD (their UTF-8 bytes, percent-encoded).

Component vs. Full URL Mode

This tool offers two encoding modes, matching JavaScript's two built-in functions:

How to Use This Tool

  1. To encode: Type or paste plain text into the left box, choose a mode, then click Encode →.
  2. To decode: Paste a percent-encoded string into the right box, then click ← Decode. Invalid sequences (e.g. a lone % or malformed %XY) will show an error.
  3. Use Swap to exchange both boxes, and Copy to copy either side to your clipboard.

Frequently Asked Questions

What is URL encoding?
URL encoding (also called percent encoding) converts characters that are not allowed in URLs into a safe format. Each unsafe character is replaced by a percent sign (%) followed by two hexadecimal digits representing the character's UTF-8 byte value. For example, a space becomes %20 and an ampersand becomes %26.
What is the difference between "Encode Component" and "Encode Full URL"?
Encode Component (encodeURIComponent) encodes all special characters including :, /, ?, #, &, and =. Use this when encoding a value that will be placed inside a URL query string or path segment. Encode Full URL (encodeURI) preserves characters that have structural meaning in a URL (:, /, ?, #, &, @, =) and only encodes characters that are truly invalid. Use this when encoding a complete URL.
When should I use URL encoding?
Use URL encoding whenever you include user-provided data in a URL — for example, search query parameters, file names in paths, or form values submitted via GET. Without encoding, special characters like spaces, &, =, and # can break the URL structure or be misinterpreted by the server.
What characters get encoded?
In Component mode, everything except letters (A–Z, a–z), digits (0–9), and the characters - _ . ! ~ * ' ( ) is encoded. In Full URL mode, the additionally preserved characters include : / ? # [ ] @ ! $ & ' ( ) * + , ; =.
Is my data safe?
Yes. This tool runs entirely in your browser using the built-in encodeURIComponent() and decodeURIComponent() JavaScript APIs. No data is sent to any server.