Skip to content

URL Encoder & Decoder

Encode special characters for safe use in URLs or decode percent-encoded URL strings back to readable text.

0 characters 0 words
Mode
Scope

Component mode encodes everything except letters, digits and - _ . ! ~ * ' ( ).

Related Tools

Case Converter Binary & Hex Converter Base64 Encoder & Decoder HTML Encoder & Decoder Strip HTML Tags

How to Use

  1. Enter a URL or Text — Paste a URL containing special characters to encode, or paste a percent-encoded string to decode.
  2. Select Encode or Decode — Choose Encode or Decode, then pick Component (for a single query value or path segment) or Full URL (keeps the URL structure such as :/?#&= intact). Tick "+ for spaces" for HTML form data.
  3. Copy the Result — The output updates as you type (or click the button). Review it, then use Copy to put it on your clipboard, or Swap to move the output back into the input.

About the URL Encoder & Decoder

The URL Encoder & Decoder converts text to percent-encoding and back. It gives you the two encoders built into every browser, encodeURIComponent for a single value and encodeURI for a whole address, plus form encoding, where spaces become +. Developers use it to build query strings and API calls by hand, marketers to check tagged campaign links, and anyone to read a long encoded link that someone pasted into a chat.

Three ways to encode

Worked examples

InputModeOutput
rock & roll / 50% off?Encode, Componentrock%20%26%20roll%20%2F%2050%25%20off%3F
rock & roll / 50% off?Encode, Component + for spacesrock+%26+roll+%2F+50%25+off%3F
https://example.com/a path/?q=café & co#topEncode, Full URLhttps://example.com/a%20path/?q=caf%C3%A9%20&%20co#top
C++ tipsEncode, Component / Full URLC%2B%2B%20tips / C++%20tips
😀Encode, any mode%F0%9F%98%80
a%2Fb%3Fc%26dDecode, Component / Full URLa/b?c&d / a%2Fb%3Fc%26d

Edge cases

When to use it

RFC 3986, the URI standard, allows the unreserved characters (letters, digits and - . _ ~) anywhere. The reserved characters : / ? # [ ] @ ! $ & ' ( ) * + , ; = act as delimiters, so they must be percent-encoded when they appear in data where they would otherwise be read as a delimiter. Typical jobs: putting a search phrase or a redirect address into a query parameter, building a mailto: link with a subject and body, fixing links that contain spaces or accents, and reading the parameters of a tracking link. The URL Encoding guide explains which characters need escaping and why. For readable page addresses, generate them with the URL Slug Generator so there is little left to encode.

Encoding and decoding use your browser's built-in functions, so links that carry tokens or personal details never leave your device.

Frequently Asked Questions

What is URL encoding (percent-encoding)?

URL encoding, formally called percent-encoding, replaces unsafe or reserved characters with a percent sign (%) followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20 and an ampersand becomes %26. This ensures the URL is parsed correctly by browsers and servers.

Which characters need to be encoded in a URL?

Reserved characters that have special meaning in URLs — such as ?, &, =, #, /, and @ — must be encoded when used as data rather than delimiters. Unsafe characters like spaces, angle brackets, curly braces, and pipe symbols should also be encoded. Unreserved characters (A-Z, a-z, 0-9, -, _, ., ~) are safe and do not require encoding.

What is the difference between encodeURI and encodeURIComponent?

In JavaScript, encodeURI encodes a full URI but preserves characters that are part of the URL structure (such as : / ? # & =). encodeURIComponent encodes everything except A-Z, a-z, 0-9 and - _ . ! ~ * ' ( ), making it appropriate for individual query parameter values. WritePadPro offers both: choose Full URL (encodeURI / decodeURI) or Component (encodeURIComponent / decodeURIComponent).

Why do spaces sometimes appear as + and sometimes as %20?

In the application/x-www-form-urlencoded format (used by HTML form submissions), spaces are encoded as +. In standard percent-encoding (RFC 3986), spaces are encoded as %20. Both are valid in their respective contexts. The tool supports both conventions: tick "+ for spaces" to encode spaces as + (form encoding, the same output as URLSearchParams) or to turn + back into spaces when decoding; leave it unticked to use %20.

Can I encode non-English characters in URLs?

Yes. Non-ASCII characters (accented letters, CJK characters, Cyrillic, etc.) are first converted to their UTF-8 byte sequences, and each byte is then percent-encoded. For example, the German umlaut ü becomes %C3%BC. Modern browsers display these as Internationalized Resource Identifiers (IRIs) but transmit them as encoded URIs.