Encode and decode URLs for web development.
The URL Encoder Decoder percent-encodes special characters in a URL or query string so it's safe to use in a link or API call, and decodes percent-encoded URLs back into readable form. It's free and works entirely in your browser — paste a URL with spaces or symbols and get a properly encoded version instantly.
Made for developers. Typical uses:
Encoding the value "100% sure" gives 100%25%20sure, and encoding a whole address such as https://example.com/a b?q=café&x=1#top with the full-URL button gives https://example.com/a%20b?q=caf%C3%A9&x=1#top, keeping the slash, question mark, equals, ampersand and hash in place.
The tool uses the browser's standard encodeURIComponent, encodeURI and decodeURIComponent functions. It does not turn a plus sign into a space when decoding, which form data sometimes needs, and it cannot repair a string with a broken percent code.
Accuracy: Output is tested against known inputs. For production code, review the result and run your own tests.
Expert Tip
Encode each value separately and then join the parts with ampersands and equals signs. Encoding an entire query string as one component escapes the separators and breaks the URL.
A URL can safely contain only a limited set of characters. Spaces, accented letters and symbols such as ampersand, question mark and hash have special meanings or are not allowed, so they are written as a percent sign followed by two hexadecimal digits that give the byte value. A space becomes %20, and the accented letter in São becomes %C3%A3 because it takes two bytes in UTF-8. The URL Encoder Decoder converts in both directions.
The tool offers the three conversions web developers use every day.
Encoding the value name=Ada Lovelace&city=São Paulo/Brazil?x=1 as a component gives name%3DAda%20Lovelace%26city%3DS%C3%A3o%20Paulo%2FBrazil%3Fx%3D1. Every structural character is escaped, which is what you want if this text is a single parameter value.
Encoding the whole address https://example.com/a b?q=café&x=1#top with the full-URL button gives https://example.com/a%20b?q=caf%C3%A9&x=1#top. The structure is intact and only the space and the accented letter are escaped.
Two details cause most mistakes. First, a literal percent sign must itself be encoded: "100% sure" becomes 100%25%20sure. Second, the plus sign is ambiguous. In an HTML form submission it means a space, but encodeURIComponent writes a real plus as %2B, and decodeURIComponent does not turn plus into a space: a+b decodes to a+b, while a%2Bb also decodes to a+b. If you decode form data, replace plus with a space first.
Decoding a string with a broken percent code, such as one that ends in %E0%A4%A, fails with the message "Invalid URL-encoded string". Check for a truncated copy or for text that was already decoded.
To break an address into its protocol, host, path and parameters, use the URL Parser. To make a readable path segment from a title, the Slug Generator is easier than encoding by hand. For binary data in text form, see the Base64 Encoder Decoder. Everything runs in your browser.
Percent encoding shows up in query strings from search forms, in links that contain file names with spaces, in redirects that carry another address as a parameter, and in tracking links. When one URL is placed inside another, as in a login redirect, the inner address must be encoded as a component, or its question marks and ampersands will be read as part of the outer URL. Decoding is useful when you want to read a long encoded link in a log file or an analytics report.
Base64 is not encryption and a hash cannot be reversed. See what each does, where JWTs and URL encoding fit, and how to pick MD5, SHA-256 or a password hash.
Explore more in Developer Tools, read the guides and articles, or see how we test our tools.
Encode text and data to Base32 format.
Best for generating or inspecting a Base32-encoded TOTP secret key for two-factor authentication setup
Encode and decode Base64 strings instantly.
Best for encoding binary data for email and web transmission
Check color contrast ratios for WCAG compliance.
Best for checking that body text color meets WCAG AA contrast requirements before shipping a website
Parse and understand cron expressions with human-readable descriptions.
Best for confirming a scheduled job in a server crontab actually runs when you think it does before deploying it
Convert external CSS to inline styles for HTML emails.
Best for converting a designed HTML email template into inline-styled markup before sending a campaign
Format and beautify messy CSS code with proper indentation.
Best for beautifying minified CSS for editing