URL Encode/Decode

Encode and decode URLs and query parameters online. Handles special characters and Unicode.

What is URL Encoding?

URL encoding (percent-encoding) converts special characters into a format that can be safely transmitted in URLs. Characters like spaces, &, =, and non-ASCII characters are replaced with percent-encoded values.

Encode vs Encode Component

  • Encode — Encodes a full URL, preserving :, /, ?, #, & characters
  • Encode Component — Encodes everything, for use in query parameter values
  • Decode — Decodes any percent-encoded string back to readable text

Video Tutorial

2:20

Video coming soon — full transcript available below

Chapters

Full transcript searchable
0:00

Why URL encoding exists and what it solves

Welcome to this URL Encoder tutorial. URLs can only contain certain characters safely — letters, numbers, and a few symbols like hyphens and underscores. Any other character must be percent-encoded: replaced with a percent sign followed by the two-digit hexadecimal code for that character. A space becomes %20, an ampersand becomes %26, a question mark becomes %3F. Without encoding, special characters in query parameters can break URL parsing, split parameters incorrectly, or cause security issues.

0:30

Encoding a URL with special characters

Open the URL Encoder on ToolPilot.dev. In the input field, paste the string you want to encode. This could be a search query, a file path, an API parameter value, or a full URL. Click Encode. The output shows the percent-encoded version where all unsafe characters have been replaced. For example, 'Hello World & More' becomes 'Hello%20World%20%26%20More'. The encoded string is safe to use as a URL parameter value.

1:00

Decoding a percent-encoded string

To decode, paste a percent-encoded string and click Decode. This converts %20 back to spaces, %26 back to ampersands, and so on. This is useful when reading API responses, log files, or browser history. When you see a URL in a server log like /search?q=hello%20world&category=web%20dev, decoding it immediately makes it human-readable: /search?q=hello world&category=web dev.

1:30

Use case: building query strings for APIs

When building REST API requests manually or in Postman, query parameter values must be URL-encoded. If a search term contains spaces, ampersands, or non-ASCII characters, encoding is required. For example, searching for 'C++ tutorial & examples' as an API parameter would be: ?q=C%2B%2B%20tutorial%20%26%20examples. Encode your parameter values here before embedding them in request URLs.

2:00

Use case: debugging encoded redirect URLs

OAuth and SSO flows often pass return URLs as encoded parameters: ?redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback%3Fsession%3D1234. Decoding reveals the actual URL: https://app.example.com/callback?session=1234. This helps when debugging authentication redirects, verifying callback URLs, or understanding nested encoded parameters in complex OAuth flows.

2:12

Wrap-up

URL encoding is a fundamental web development skill that's easy to overlook until something breaks. The URL Encoder on ToolPilot.dev handles encoding and decoding instantly in your browser with no server involved. Use it whenever you're working with query parameters, redirect URLs, or any user-provided string that needs to be safely embedded in a URL. Visit ToolPilot.dev for this and 19 other free developer tools.

Transcript covers all 6 chapters (2:20 total).

Benchmark

Fastest URL Encoder/Decoder Comparison 2026

We benchmarked this tool vs urlencoder.org, urlencode.net, and CyberChef across 6 input sizes and 12 special character categories.

See Results →

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 using a '%' sign followed by the character's hexadecimal code. For example, a space becomes %20 or +.
Why do I need to URL encode query parameters?
Special characters like &, =, ?, #, and spaces have special meanings in URLs. URL encoding ensures they are treated as literal values in query parameters rather than interpreted as URL structure.
What characters need to be URL encoded?
Characters that need encoding include spaces, &, =, +, ?, #, %, /, :, @, and non-ASCII Unicode characters. Letters, digits, hyphens, underscores, periods, and tildes are safe and do not need encoding.
What is the difference between encodeURI and encodeURIComponent in JavaScript?
encodeURI() encodes a full URL and preserves characters like / and ?. encodeURIComponent() encodes a URL component (like a query parameter value) and encodes those structural characters too. Use encodeURIComponent() for individual parameter values.
How do I URL decode a string?
Paste the percent-encoded URL string into the URL Encoder tool and click 'Decode URL'. The tool converts all %XX sequences back to their original characters.
What is the difference between %20 and + for spaces in URLs?
Both represent spaces, but in different contexts. %20 is the RFC 3986 standard and works in path segments and query values. The + sign represents a space only in application/x-www-form-urlencoded format (HTML forms).
Can I URL encode Unicode characters?
Yes. Unicode characters are first converted to UTF-8 bytes, then each byte is percent-encoded. For example, the Euro sign (€) becomes %E2%82%AC.
How do I URL encode in Python?
In Python, use urllib.parse.quote() for path segments and urllib.parse.quote_plus() for query parameters: from urllib.parse import quote; quote('hello world') returns 'hello%20world'.
How do I URL encode in JavaScript?
Use encodeURIComponent() for query parameter values: encodeURIComponent('hello world & more') returns 'hello%20world%20%26%20more'. Use this tool to quickly test and verify your encoding.
What happens if I don't URL encode special characters?
Unencoded special characters can corrupt your URL structure, cause 400 Bad Request errors, truncate query parameters at & signs, or result in incorrect routing on the server.

Code Examples

Ready-to-use implementations in popular programming languages. Copy, paste, and run.

URL Encode/Decode in JavaScript
// Encode a URL component
const encoded = encodeURIComponent('hello world&foo=bar');
console.log(encoded); // hello%20world%26foo%3Dbar

// Decode a URL component
const decoded = decodeURIComponent('hello%20world%26foo%3Dbar');
console.log(decoded); // hello world&foo=bar

// Build query string from object
const params = new URLSearchParams({ q: 'search term', page: '1' });
console.log(params.toString()); // q=search+term&page=1

Related Workflow Guides

Compare with alternatives