URL Encoder / Decoder

Encode and decode URLs online. Convert special characters to URL-safe format for use in web addresses and API calls.

Input

Plain Text

Output

Encoded Text

Common Use Cases

Email Address

user@example.com

Query with Spaces

hello world test

Special Characters

!@#$%^&*()+=[]{}|;:'",.<>?

URL with Parameters

https://example.com?name=John Doe&age=30

International Text

Hello 世界 مرحبا мир

File Path

/path/to/file name.txt

JSON String

{"name": "John", "age": 30}

HTML Content

<div class="test">Hello & Goodbye</div>

Web Safe

Convert special characters to URL-safe format for use in web addresses

Multiple Methods

Choose between standard, full URI, or custom encoding methods

Character Analysis

See exactly which characters need encoding and their encoded values

Query Builder

Parse and build query strings with automatic parameter encoding

When to Use URL Encoding

Query Parameters

Encode values passed in URL query strings to handle spaces and special characters

Form Data

When submitting forms with application/x-www-form-urlencoded content type

API Calls

Encode parameters in REST API URLs to ensure proper transmission

File Paths

Handle spaces and special characters in file paths within URLs

Code Examples

JavaScript

// Encode
encodeURIComponent('hello world') // "hello%20world"

// Decode
decodeURIComponent('hello%20world') // "hello world"

Python

import urllib.parse

# Encode
urllib.parse.quote('hello world') # "hello%20world"

# Decode
urllib.parse.unquote('hello%20world') # "hello world"

PHP

// Encode
urlencode('hello world'); // "hello+world"
rawurlencode('hello world'); // "hello%20world"

// Decode
urldecode('hello%20world'); // "hello world"

Frequently Asked Questions

What's the difference between encodeURI and encodeURIComponent?
encodeURI() is used to encode complete URIs and preserves characters that are valid in URIs (like :, /, ?, #).encodeURIComponent() encodes all special characters and is used for encoding individual URI components like query parameter values. Use encodeURIComponent for query string values and encodeURI for complete URLs.
Why do spaces become %20 or +?
Spaces can be encoded as either %20 or + depending on the context. In URLs, %20 is the percent-encoded representation of a space. However, in application/x-www-form-urlencoded data (like form submissions), spaces are encoded as +. Both are valid, but %20 is more universally compatible.
Which characters need to be encoded?
Reserved characters that have special meaning in URLs must be encoded: ! * ' ( ) ; : @ & = + $ , / ? # [ ]. Additionally, any character outside the unreserved set (A-Z, a-z, 0-9, -, _, ., ~) should be encoded. This includes spaces, quotes, angle brackets, and non-ASCII characters.
How do I handle Unicode/international characters?
Unicode characters are first converted to UTF-8 bytes, then each byte is percent-encoded. For example, the character "世" (U+4E16) becomes %E4%B8%96 in UTF-8 encoding. Modern browsers and servers handle this automatically when you use standard encoding functions.

Free URL Encoder & Decoder Online

URLs can only contain a limited set of characters from the ASCII character set. Special characters like spaces, ampersands, equals signs, and non-ASCII characters must be percent-encoded (also called URL encoding) to be safely transmitted in a URL. Our free URL encoder converts any text into a properly encoded URL-safe string, and our decoder reverses the process instantly.

Whether you're encoding a query parameter value, decoding a URL you received from an API, or working with internationalized domain names and Unicode paths, this tool handles it all — right in your browser with no data sent to any server.

How to Encode or Decode a URL

  1. 1

    Paste your text or URL

    Enter the string you want to encode or decode into the input field. You can paste a full URL, a query string, or just a parameter value.

  2. 2

    Choose encode or decode

    Select whether you want to URL-encode (convert special chars to %XX format) or URL-decode (convert %XX back to readable text).

  3. 3

    Select encoding type

    Choose between encodeURIComponent (for query parameter values) or encodeURI (for full URLs). encodeURIComponent is the most common choice.

  4. 4

    Copy the result

    The encoded or decoded output appears instantly. Click the copy button to grab it for use in your code, browser, or API request.

When to Use URL Encoding

API Query Parameters

When building API requests, parameter values containing &, =, +, or spaces must be encoded to avoid breaking the query string structure.

Form Submissions

HTML forms URL-encode field values automatically, but when building query strings manually in JavaScript, you must encode values yourself.

Redirect URLs

When passing a URL as a parameter to another URL (e.g., a login redirect), the inner URL must be fully encoded to avoid ambiguity.

Internationalization

URLs with non-ASCII characters (Japanese, Arabic, emoji, accented letters) must be percent-encoded for compatibility with all HTTP clients.

Debugging API Calls

Decode percent-encoded URLs from server logs, error messages, or API responses to read them in plain text.

OAuth & Authentication

OAuth 1.0 and many security protocols require precise URL encoding of query parameters to generate valid signatures.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL and leaves characters like /, ?, &, = untouched (since they have structural meaning in URLs). encodeURIComponent encodes everything except letters, digits, and - _ . ~ — making it suitable for encoding individual parameter values.
What characters get percent-encoded?
Any character not in the "unreserved" set (A-Z, a-z, 0-9, hyphen, underscore, period, tilde) gets encoded. For example: space → %20, & → %26, = → %3D, / → %2F, # → %23.
Why does a space sometimes become + instead of %20?
In application/x-www-form-urlencoded format (used by HTML forms), spaces are encoded as +. In standard percent encoding, spaces are %20. Our tool uses %20 (standard URL encoding).
Is URL encoding the same as HTML encoding?
No. URL encoding converts characters to %XX hex sequences for use in URLs. HTML encoding converts characters to &amp;, &lt;, etc. for display in HTML. They are different systems for different contexts.
Can I URL-encode an entire URL?
Yes, but you typically only want to encode specific query parameter values, not the full URL. Encoding the full URL would also encode the slashes and colons, making it unreadable by browsers.

URL Encoding Reference

Common percent-encoded characters: space = %20, ! = %21, " = %22, # = %23, $ = %24, % = %25, & = %26, ' = %27, ( = %28, ) = %29, * = %2A, + = %2B, , = %2C, / = %2F, : = %3A, ; = %3B, = = %3D, ? = %3F, @ = %40, [ = %5B, ] = %5D.

Popular searches: url encoder decoder online • percent encoding tool • encode url online free • decode url online • query string encoder • uri encoder online • url special characters encode • url encode space • url decode online tool