URL Encoder & Decoder
URLs can only contain certain characters. When a URL needs to include a space, a special symbol, or characters from another language, those characters must be encoded into a safe format using percent signs and numbers. This tool lets you encode any text into URL-safe format, or decode an encoded URL back to readable text. It is useful for web developers building links with query parameters, or for anyone trying to read a URL that looks like a jumble of percent signs and numbers. Just paste your text and click Encode or Decode.
Frequently Asked Questions
What is URL encoding?
URL encoding converts special characters into a format safe for use in a URL. Characters like spaces, ampersands, and equals signs are replaced with a percent symbol followed by two hex digits. For example, a space becomes %20 and & becomes %26.
Why do URLs have percent signs in them?
Percent signs indicate encoded characters. URLs can only safely contain a limited set of characters, so any others must be encoded. Decoding converts percent-encoded characters back to their normal readable form.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL but leaves structural characters like slashes and colons intact. encodeURIComponent encodes everything including those characters, and is used for encoding individual query string parameter values in code.
When would I need to encode a URL?
You need URL encoding when building links that contain user input, spaces, or special characters. Browsers often encode URLs automatically when you type them, but in code you must encode them yourself to avoid errors and security issues.
What characters must be percent-encoded in a URL?
Any character outside the safe set must be encoded. Safe characters are: A-Z, a-z, 0-9, and the four symbols - _ . ~. Everything else — spaces (%20), & (%26), = (%3D), # (%23), and so on — must be percent-encoded when used as literal data. Reserved characters like ? and / only need encoding when they appear in values, not as URL structure.
What is the difference between %20 and + for spaces in URLs?
Both represent a space, but in different contexts. %20 is the correct encoding in URL paths and in modern query strings. The + symbol represents a space only in form-submitted query strings (application/x-www-form-urlencoded format). In a URL path segment, + is a literal plus sign, not a space. Use %20 everywhere to be safe.
Does URL encoding affect SEO?
It can. URLs with special characters or non-ASCII text may display correctly in browsers but cause problems with some crawlers and link-sharing tools. Google can index UTF-8 URLs, but keeping slugs in lowercase ASCII with hyphens as separators (kebab-case) is the most SEO-friendly format. Avoid encoding characters that do not need it, as this makes URLs harder to read and share.
How It Works
URL encoding uses JavaScript's built-in encodeURIComponent() to convert each unsafe character to its percent-encoded equivalent. Decoding uses decodeURIComponent(). The percent sign followed by two hex digits (e.g., %20 for space, %40 for @) is the universal format defined in RFC 3986. This tool processes the full input string in one pass.
encodeURI vs encodeURIComponent
encodeURI() encodes a complete URL and preserves its structure — it leaves /, ?, &, =, and # intact. encodeURIComponent() encodes everything including those characters and is for encoding individual parameter values. Always use encodeURIComponent() for user input going into a URL query string, not encodeURI().
Security Implications
Failing to URL-encode user input before inserting it into a URL is a security vulnerability. Unencoded special characters can break the URL structure, redirect users to unintended paths, or enable open redirect attacks. Always encode user-supplied values before including them in URL parameters, especially if those URLs are used in server-side redirects.
When to Use This
Use to encode a search query or user input before appending it to a URL in JavaScript, to decode a percent-encoded URL from a log file or API response to read it, to build a properly formatted tracking link or affiliate URL, or to check what a URL looks like after the browser normalizes it.
More Free Tools
Hash Generator
Generate SHA-256, SHA-1, and SHA-512 cryptographic hashes from any text.
Random Password Generator
Generate strong, random passwords with custom length and character options.
What Browser Am I Using?
Instantly see your browser name, version, operating system, screen size, and more.
Perspective Text Generator
Create 3D perspective text with a draggable vanishing point. Shows per-character projection math. Download as PNG.