URL Encoder / Decoder

URL Encoder / Decoder

Encode or decode URLs, query strings, and URI components instantly — 100% client-side, nothing sent to any server.
Mode
Encoding Type

0 chars

Tip: Ctrl+Enter to process

Enter your text and press
Encode or Decode

Encoded Output

Input Length
Characters
Output Length
Characters
Chars Encoded
Sequences
Method
Type
Encoded Result

URL Encoding Guide

Understand percent-encoding, the three encoding modes, common character mappings, and real-world use cases.
What is URL Encoding?

URL encoding (percent-encoding) replaces unsafe or reserved ASCII characters with a % followed by two hex digits. This ensures URLs remain valid across every browser, server, and system.

Space encodes to %20 (or + in forms)
Defined by RFC 3986
Used in every HTTP request
Example

Encoding a query string with special characters:

Input hello world & name=João
Encoded (Component) hello%20world%20%26%20name%3DJo%C3%A3o
Space → %20 · & → %26 · = → %3D · ã → %C3%A3
The Three Encoding Types Explained
Component Most Common

Uses encodeURIComponent(). Encodes everything except unreserved chars: A–Z a–z 0–9 - _ . ! ~ * ' ( ).

Use for individual query parameter values.

Full URI

Uses encodeURI(). Preserves characters valid in a complete URL structure.

Use when encoding a whole URL — keeps slashes and query markers intact.

Form

Like Component, but spaces become + instead of %20.

Use for HTML form POST bodies and legacy query strings.

Common Character Encoding Reference
Character Percent-Encoded Form (+) Encoded Description
(space)%20+Space character
!%21%21Exclamation mark
#%23%23Hash / fragment identifier
&%26%26Ampersand — param separator
+%2B%2BPlus sign
/%2F%2FForward slash — path separator
=%3D%3DEquals sign — key/value separator
?%3F%3FQuestion mark — query start
@%40%40At sign
[%5B%5BOpening bracket
]%5D%5DClosing bracket
When to Use URL Encoding
Query Parameters

Always encode values appended to URLs as query params. Unencoded &, =, and # break URL parsing.

Form Submissions

Use Form mode to manually prepare application/x-www-form-urlencoded payloads or debug form POST bodies.

API Calls & Debugging

Decode received URLs to inspect parameters, or encode values before inserting into fetch requests to prevent injection errors.

Frequently Asked Questions
Q1: What is the difference between %20 and + for spaces?

%20 is the standard percent-encoding for a space (RFC 3986). The + sign represents a space only in application/x-www-form-urlencoded data — in a URL path, + is a literal plus sign.

Q2: Is URL encoding the same as Base64?

No. URL encoding replaces unsafe characters with %xx hex sequences. Base64 converts binary data to a 64-character alphabet. Use URL encoding for URLs; Base64 for binary data in text contexts.

Q3: When should I use encodeURI vs encodeURIComponent?

Use encodeURI for a complete URL — it preserves structural characters like /, ?, and #. Use encodeURIComponent for individual parameter values — it also encodes those structural characters.

Q4: Is URL decoding safe on untrusted input?

Decoding itself is safe, but always validate decoded values before use. Watch for double-encoded input (e.g., %2520) which can bypass security filters — decode exactly once then sanitise.