Free Tool
4.9/5

Free URL Encoder / Decoder

Encode or decode URLs with percent encoding in real time. Supports encodeURIComponent, encodeURI, and Base64, runs entirely in your browser.

0 characters
0 characters

Quick reference

(space)%20!%21#%23$%24&%26+%2B/%2F:%3A=%3D?%3F@%40

Need to shorten those long URLs?

Turn encoded URLs into clean, branded short links with Flyn. Get click analytics, QR codes, and A/B testing built in.

Shorten for free

How to Encode or Decode a URL in 3 Steps

Step 1: Paste your text or URL, URL Encoder/Decoder screenshot
1

Paste your text or URL

Enter the text you want to encode, or paste an encoded URL you want to decode into the input field.

Step 2: Choose your mode, URL Encoder/Decoder screenshot
2

Choose your mode

Select Encode or Decode, then pick encodeURIComponent, encodeURI, or Base64 mode depending on your needs.

Step 3: Copy the result, URL Encoder/Decoder screenshot
3

Copy the result

The output updates instantly. Click copy to use it in your code, API calls, or URLs.

Why Use This URL Encoder/Decoder?

A fast, private, developer-friendly tool for encoding and decoding URLs.

Real-time conversion

Results appear as you type, no submit button needed. Instant encoding and decoding with zero delay.

encodeURI vs encodeURIComponent

See both encoding outputs side by side. Understand which one to use for full URLs vs. query parameter values.

100% client-side

All encoding and decoding happens in your browser. Your data never leaves your device, fully private.

Base64 support

Toggle between URL percent encoding and Base64 encoding/decoding. Handles Unicode and multi-byte characters.

Character reference

Quick reference table showing common characters and their percent-encoded equivalents for fast lookup.

Error handling

Graceful handling of malformed encoded strings. Clear error messages when decoding invalid percent sequences or Base64.

What Is URL Encoding and Why Does It Matter?

URLs can only contain a limited set of characters from the ASCII character set. Characters like spaces, ampersands (&), question marks (?), and non-ASCII characters (accented letters, emoji, CJK characters) must be converted to a safe format before being placed in a URL. This process is called percent encoding or URL encoding.

Percent encoding works by replacing each unsafe character with a percent sign (%) followed by two hexadecimal digits representing the character's byte value in UTF-8. For example, a space becomes %20, an ampersand becomes %26, and the emoji becomes %F0%9F%98%80.

Getting URL encoding wrong can break links, corrupt query parameters, cause API errors, or create security vulnerabilities. This tool helps you encode and decode URLs correctly, showing you both encodeURIComponent and encodeURI outputs so you always use the right one.

Common URL Encoding Reference

Character

Encoded

Description

(space)

%20

Space

!

%21

Exclamation mark

#

%23

Hash / Fragment

$

%24

Dollar sign

&

%26

Ampersand (query separator)

+

%2B

Plus sign

,

%2C

Comma

/

%2F

Forward slash (path separator)

:

%3A

Colon (scheme separator)

=

%3D

Equals (key=value separator)

?

%3F

Question mark (query start)

@

%40

At sign

encodeURI vs encodeURIComponent, Which One to Use?

encodeURIComponent

Use this when encoding a value that will be placed into a URL, like a query parameter value, a path segment, or a fragment. It encodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ).

const url = `https://example.com/search?q=${encodeURIComponent(userInput)}`;

encodeURI

Use this when encoding a full URL that may contain non-ASCII characters but already has valid URL structure. It preserves : / ? # [ ] @ ! $ & ' ( ) * + , ; = so the URL structure stays intact.

const safeUrl = encodeURI('https://example.com/path/to/file with spaces.html');

Frequently Asked Questions

What is URL encoding (percent encoding)?
URL encoding, also known as percent encoding, is the process of converting characters into a format that can be safely transmitted in a URL. Characters that are not allowed in URLs (like spaces, &, =, ?, #) are replaced with a percent sign (%) followed by their two-digit hexadecimal ASCII value. For example, a space becomes %20 and an ampersand becomes %26. This ensures URLs are valid and unambiguous across all browsers and servers.
When should I URL-encode a string?
You should URL-encode a string whenever it is used as a query parameter value, path segment, or fragment in a URL. Common cases include: passing user input as query parameters (e.g., search terms), embedding URLs inside other URLs (like redirect parameters), sending form data via GET requests, and passing special characters in API calls. If your string contains spaces, ampersands, question marks, equals signs, or any non-ASCII characters, it must be encoded.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URI but preserves characters that are part of the URL structure, like :, /, ?, #, &, and =. It is meant for encoding a complete URL. encodeURIComponent encodes everything except letters, digits, and a few safe characters (- _ . ! ~ * ' ( )). It is meant for encoding individual values that will be placed into a URL, such as query parameter values. In most cases, you want encodeURIComponent for encoding user input that goes into a URL.
Which characters are not encoded by encodeURIComponent?
encodeURIComponent does not encode the following characters: A-Z, a-z, 0-9, and the special characters - _ . ! ~ * ' ( ). All other characters, including spaces, &, =, ?, /, #, @, +, and any non-ASCII characters like accented letters or emoji, are percent-encoded. For example, a space becomes %20, an ampersand becomes %26, and a forward slash becomes %2F.
What is the difference between Base64 encoding and URL encoding?
URL encoding (percent encoding) converts unsafe URL characters into %XX format so they can appear safely in URLs. Base64 encoding converts any binary or text data into a string of ASCII characters using A-Z, a-z, 0-9, +, and /. They serve different purposes: URL encoding makes strings URL-safe, while Base64 encoding is used for embedding binary data (like images) in text formats, transmitting data in APIs, or encoding credentials. Base64 output is not URL-safe by default, you may need to URL-encode a Base64 string if placing it in a URL.
Why do spaces sometimes appear as %20 and sometimes as +?
Both %20 and + represent a space, but in different contexts. In standard URL encoding (RFC 3986), a space is encoded as %20. In HTML form submissions using application/x-www-form-urlencoded (the default for forms), spaces are encoded as +. The encodeURIComponent function always uses %20. When decoding, decodeURIComponent handles %20 but not + as a space, you would need to replace + with spaces manually if parsing form-encoded data.
How do I encode non-ASCII characters like emoji or accented letters?
Non-ASCII characters (like emoji, Chinese characters, or accented letters) are first converted to their UTF-8 byte sequences, and then each byte is percent-encoded. For example, the euro sign (EUR) becomes %E2%82%AC (three UTF-8 bytes). The emoji face becomes %F0%9F%98%80 (four UTF-8 bytes). JavaScript's encodeURIComponent handles this automatically, it correctly converts any Unicode string to its percent-encoded UTF-8 representation.
Is URL encoding the same as HTML encoding?
No, URL encoding and HTML encoding are different. URL encoding (percent encoding) converts characters to %XX format for use in URLs. HTML encoding converts characters to HTML entities for safe display in web pages, for example, < becomes &lt;, > becomes &gt;, and & becomes &amp;. You use URL encoding when building URLs and query strings, and HTML encoding when displaying user content in HTML to prevent XSS attacks.
Can I decode a URL that has been encoded multiple times?
Yes, but you need to decode it the same number of times it was encoded. If a URL was double-encoded (for example, a space became %20, then the % was encoded again to %2520), you need to run decodeURIComponent twice. Our tool decodes one layer at a time, just paste the output back as input to decode additional layers. Be careful: applying decode more times than the string was encoded will result in errors or corrupted text.
Is this URL encoder/decoder free? Do I need to sign up?
Yes, this URL encoder/decoder is 100% free with no sign-up required. All encoding and decoding happens entirely in your browser, your data never leaves your device. You can encode and decode unlimited strings, switch between URL encoding and Base64, and save your conversion history locally. If you need to shorten encoded URLs, you can sign up for a free Flyn account.

Ready to shorten and track your links?

Combine URL tools with Flyn's link shortener for branded short links, real-time click analytics, QR codes, and A/B testing, all in one platform.