Vortenza - Free Online Tools and CalculatorsBrowse tools

URL Encoder and Decoder

Encode or decode URLs and query strings instantly. Parse URL components, encode individual parameters, and copy results with one click. Free, no signup, browser-only.

Mode:

Use for encoding a single parameter value. Encodes all special characters.

0 characters

Output will appear here...

0 characters

Quick examples:

When to use URL encoding and why it matters

URL encoding is required whenever you include special characters in a URL. Characters like spaces, ampersands, equals signs, and non-ASCII letters have special meaning in URLs or are simply not allowed. Without encoding, a URL with a space or & in a parameter value will break or produce unexpected results in the browser or server.

The most common case is building URLs with query parameters programmatically. If a search query contains an ampersand, like “cats & dogs,” the unencoded URL would be /search?q=cats & dogs which the server interprets as two parameters. The correctly encoded version is /search?q=cats%20%26%20dogs which passes the full phrase as a single value. When debugging patterns in encoded strings, a regex tester is a useful companion for matching and extracting URL components.

encodeURI vs encodeURIComponent: which one to use?

Use encodeURIComponent when encoding individual query parameter values or path segments. Use encodeURI only when encoding a complete URL that already has its structure in place. The key difference is that encodeURIComponent encodes the characters : / ? # & = while encodeURI leaves them unchanged because they serve as URL structure delimiters.

A common mistake is using encodeURI on a query parameter value that contains an ampersand or equals sign. The ampersand will not be encoded and will break the query string structure. Always use encodeURIComponent for parameter values. The Component option in the encoder above applies encodeURIComponent, which is the correct choice for almost all use cases.

How to parse URL query parameters

Use the URL Parser tab above to break any URL into its scheme, hostname, path, query string, and fragment. Each query parameter is shown in a table with its encoded and decoded values. In JavaScript, the URLSearchParams API parses query strings: new URLSearchParams(window.location.search) gives you an object you can query with .get('key').

Query strings are case-sensitive for parameter values but handling of parameter names varies by server. Multiple values for the same key (like ?tag=a&tag=b) are common in filtering interfaces. The URL Parser above shows all parameters including duplicates. When working with API responses that carry encoded payloads, a JSON formatter or a Base64 encoder are useful for inspecting decoded values.

Frequently asked questions about URL encoding and decoding

What is URL encoding?

URL encoding (also called percent encoding) converts characters that are not allowed in URLs into a safe format using a percent sign followed by two hex digits. For example, a space becomes %20, an ampersand becomes %26, and a forward slash becomes %2F. This ensures URLs remain valid when they contain special characters.

How do I encode a URL online?

Paste your URL or text into the input field above and the tool converts all special characters to their percent-encoded equivalents instantly. You can also use the Query String tab to encode individual parameter values before adding them to a URL.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL and leaves characters like : / ? # & = unchanged since they have meaning in URLs. encodeURIComponent encodes a single URL component (like a query parameter value) and encodes those reserved characters too. Use encodeURIComponent for individual parameter values and encodeURI for complete URLs.

Why does a space become %20 in URLs?

Spaces are not allowed in URLs because they would break the URL structure. The percent encoding for a space is %20 (hex 20 = decimal 32 = ASCII space). Some forms encode spaces as + signs instead, which is called application/x-www-form-urlencoded format. The decoder above handles both %20 and + as spaces.

What characters need to be URL encoded?

Characters that must be encoded in URL components include: space, quotes (" and '), angle brackets (< >), curly braces, pipe (|), backslash (\), caret (^), backtick, and any non-ASCII characters like accented letters or emoji. Reserved characters like & = + need encoding when used as data, not as URL structure.

How do I decode a percent-encoded URL?

Switch to Decode mode above and paste your percent-encoded URL. The tool replaces each %XX sequence with the corresponding character. For example, Hello%20World becomes Hello World and caf%C3%A9 becomes cafe with an accent. Multi-byte UTF-8 sequences are handled correctly.

What is a query string in a URL?

A query string is the part of a URL after the ? character that contains key-value pairs separated by &. In https://example.com/search?q=hello+world&lang=en, the query string has two parameters: q with value hello world and lang with value en. The URL Parser tab above breaks any URL into its components.

How do I encode special characters in a query parameter?

Use encodeURIComponent to encode query parameter values. This encodes spaces as %20, ampersands as %26, equals signs as %3D, and all other reserved characters. In the tool above, use the Query String tab to enter key-value pairs and get the properly encoded query string output.

What does %2F mean in a URL?

%2F is the percent encoding for a forward slash (/). When a forward slash appears in a URL query parameter value rather than as a path separator, it must be encoded as %2F to avoid being interpreted as a path separator. Paste any percent-encoded URL into the decoder above to see all decoded characters.

Can I encode emoji in a URL?

Yes. Emoji and other non-ASCII characters are encoded as UTF-8 byte sequences in URLs. For example, the 😀 emoji becomes %F0%9F%98%80 in a URL. Modern browsers display the decoded emoji in the address bar, but the underlying URL uses percent encoding. The encoder above handles emoji and international characters correctly.