URL Encoder
Encode and decode URL components online for safe query strings and API parameters
How to use URL Encoder
Enter text to encode or decode
Paste or type your URL or text string into the input area.
Choose encode or decode
Select Encode to convert special characters to percent-encoded form, or Decode to convert percent-encoded sequences back to readable text.
Copy the output
The result appears instantly. Click Copy to copy it to your clipboard.
Mode
Scope
What is URL encoding?
A space cannot appear in a URL. Neither can an ampersand inside a parameter value, an accented letter, or an emoji — not literally. Percent-encoding is the escape mechanism that lets all of them through, replacing each byte with % followed by two hexadecimal digits.
URL decoding reverses this process, converting percent-encoded sequences back to their original characters. This tool handles both encoding and decoding, and supports both standard URL encoding and the encodeURIComponent variant used in web development.
The failure mode is quiet rather than loud. A search for 'C++ programming & design' that reaches the server with its plus signs and ampersand unencoded does not raise an error; it silently arrives as a different query, because & terminated the parameter and + was read as a space. Redirect URLs passed as parameters need their own encoding pass to survive being nested inside another URL. Internationalised paths carrying accented, CJK, or emoji characters require percent-encoding simply to satisfy the URI specification (RFC 3986).
Understanding the difference between encodeURI and encodeURIComponent is critical for avoiding subtle bugs. encodeURI is designed for encoding a complete URL — it preserves structural characters like ://?#[]@!$&'()*+,;= that have meaning in URL syntax. encodeURIComponent encodes everything except unreserved characters (A-Z, a-z, 0-9, -, _, ., ~), making it the correct choice for encoding individual query parameter values, path segments, and fragment identifiers. Using encodeURI on a query parameter value that contains & or = will silently corrupt the URL structure. This tool defaults to encodeURIComponent behavior, which is the safer choice for most use cases.
Frequently asked questions
What is the difference between URL encoding and encodeURIComponent?
Standard URL encoding preserves characters that have structural meaning in URLs (like /, ?, &, =). encodeURIComponent encodes all of these, making it suitable for encoding individual query parameter values where those characters would otherwise break the URL structure.
Why do URLs have %20 instead of spaces?
Spaces are not valid in URLs. The HTTP specification requires spaces to be percent-encoded as %20 (or + in query strings). This ensures the URL is transmitted correctly by all HTTP clients and servers.
What characters need to be URL encoded?
Any character outside the unreserved set (A-Z, a-z, 0-9, hyphen, underscore, period, tilde) must be percent-encoded in URLs. This includes spaces, accented characters, punctuation, and all Unicode characters.
Why do I see %20 in my URL when I expect a plus sign?
Spaces can be encoded two ways: %20 (standard percent-encoding) or + (form-data encoding used in query strings). This tool uses %20 by default, which is correct for all URL positions. The + convention only applies to the query string portion of a URL.
How do I encode a URL that contains another URL as a parameter?
When passing a URL as a query parameter value (e.g., a redirect URL), encode the inner URL with encodeURIComponent. This converts the inner URL's special characters (://?&=) to percent-encoded form so they do not interfere with the outer URL's structure. For example, https://example.com?redirect=https%3A%2F%2Fother.com%2Fpage%3Fid%3D1 correctly preserves both URLs.
How do I decode a URL with Unicode characters?
Paste the percent-encoded URL into the input and select Decode. Sequences like %E4%B8%AD%E6%96%87 are converted back to their original Unicode characters. The tool handles multi-byte UTF-8 sequences correctly, so CJK characters, accented letters, emoji, and other non-ASCII text will decode properly.
Related tools
Base64 Encoder
Encode and decode Base64 strings and files for APIs, emails, and data URIs
JSON Formatter
Format, validate, and prettify JSON data online for API debugging and code review
Hash Generator
Generate MD5, SHA-256, SHA-512, BLAKE3, and 25+ cryptographic hashes to verify file integrity
Regex Tester
Test and debug regular expressions online with live matching and capture groups
Compress PDF
Reduce PDF file size while maintaining quality
Related guides
Working with JSON: Formatting, Validation, and Debugging
A practical guide to working with JSON data, covering formatting, validation, common errors, debugging techniques, and useful developer tools.
Regular Expressions: A Practical Guide for Developers
Learn regular expressions from the ground up with practical examples, common patterns, debugging tips, and a reference of essential regex syntax.
Base64 Encoding and Decoding: Developer Guide
Learn what Base64 encoding is, how it works, when to use it, and common pitfalls. Covers data URIs, API payloads, email attachments, and JWT tokens.
URL Encoding: Percent-Encoding for Web Developers
A practical reference for URL encoding (percent-encoding), covering reserved characters, query parameters, internationalized URLs, and common encoding mistakes.