Convert
Encode and decode URLs
Put a value into a URL safely, or read one that was already put there.
Encoding follows encodeURIComponent, which is the function for a value inside a query string or a path segment: unreserved characters stay as they are and everything that would end the value early — &, =, ?, #, / and a space — is escaped.
Decoding is decodeURIComponent. A % that is not followed by two hexadecimal digits is an error there, and it is reported as one rather than skipped, because silently ignoring it turns a broken link into a subtly different working one.
A literal plus stays a plus. Turning + into a space is a rule from HTML form submission, not from URLs, and a tool that does it without saying so corrupts base64 in query strings and arithmetic alike.
Questions
Should I use this for a whole URL?
No. Encoding a whole URL escapes its :// and / as well, which breaks it. Encode the value you are putting inside, not the address.
Why did + not become a space?
Because + means a space only in form-encoded bodies (application/x-www-form-urlencoded), not in a URL. The rule is stated on the page instead of being applied silently.
What do %20 and %2F mean?
%20 is a space and %2F is a slash: the escapes for characters that would otherwise change the structure of the URL.
Is the text uploaded?
No. Encoding and decoding are a function call in the page.
More text and code
- Word counterWords, characters, sentences and reading time, counted as you type.
- Case converterTitle Case, sentence case, camelCase, snake_case and the rest, at once.
- JSON formatterValidates JSON and prints it indented, with the parser’s own error.
- Base64Encode text to base64 and decode it back, UTF-8 safe.
- Hash generatorSHA-256, SHA-1 and SHA-512 of any text, from the browser’s own crypto.
- UUID generatorFive version-4 UUIDs from the browser’s random source, ready to copy.
- Timestamp converterEpoch seconds, milliseconds, ISO 8601, UTC and your own time zone.
- Colour converterHEX, RGB and HSL from one value, with WCAG contrast ratios.
- Slug generatorA clean URL slug from any title, accents and punctuation handled.
- CSV to JSONRows to objects, with quoted commas, semicolons and tabs handled.
- Text diffTwo texts, line by line: what was added and what was removed.