Skip to main content
Utilavo
%

URL Encoder

Encode and decode URL components online for safe query strings and API parameters

How to use URL Encoder

  1. Enter text to encode or decode

    Paste or type your URL or text string into the input area.

  2. Choose encode or decode

    Select Encode to convert special characters to percent-encoded form, or Decode to convert percent-encoded sequences back to readable text.

  3. Copy the output

    The result appears instantly. Click Copy to copy it to your clipboard.

Mode

Scope

What is URL encoding?

URL encoding (also called percent-encoding) converts characters that are not safe in URLs into a format that can be transmitted over the internet. Characters like spaces, ampersands, and non-ASCII text are converted to % followed by their hexadecimal code — for example, a space becomes %20.

URL decoding reverses this process, converting percent-encoded sequences back to their original characters. This tool handles both encoding and decoding, and supports both standard URL encoding and the encodeURIComponent variant used in web development.

URL encoding is a fundamental part of web development that every developer encounters regularly. When building search functionality, form submissions, or API integrations, query parameters must be properly encoded to handle special characters safely. A user searching for 'C++ programming & design' needs those plus signs, ampersand, and spaces encoded correctly to avoid breaking the URL structure. Redirect URLs passed as query parameters need double-encoding to preserve the inner URL's structure. Internationalized domain names and paths with non-ASCII characters (accented letters, CJK characters, emoji) all require percent-encoding to comply with the URI specification (RFC 3986).

Understanding the difference between encodeURI and encodeURIComponent is critical for avoiding subtle bugs. encodeURI is designed for encoding a complete URL — it preserves structural characters like ://?#[]@!$&'()*+,;= that have meaning in URL syntax. encodeURIComponent encodes everything except unreserved characters (A-Z, a-z, 0-9, -, _, ., ~), making it the correct choice for encoding individual query parameter values, path segments, and fragment identifiers. Using encodeURI on a query parameter value that contains & or = will silently corrupt the URL structure. This tool defaults to encodeURIComponent behavior, which is the safer choice for most use cases.

Frequently asked questions

What is the difference between URL encoding and encodeURIComponent?

Standard URL encoding preserves characters that have structural meaning in URLs (like /, ?, &, =). encodeURIComponent encodes all of these, making it suitable for encoding individual query parameter values where those characters would otherwise break the URL structure.

Why do URLs have %20 instead of spaces?

Spaces are not valid in URLs. The HTTP specification requires spaces to be percent-encoded as %20 (or + in query strings). This ensures the URL is transmitted correctly by all HTTP clients and servers.

What characters need to be URL encoded?

Any character outside the unreserved set (A-Z, a-z, 0-9, hyphen, underscore, period, tilde) must be percent-encoded in URLs. This includes spaces, accented characters, punctuation, and all Unicode characters.

Why do I see %20 in my URL when I expect a plus sign?

Spaces can be encoded two ways: %20 (standard percent-encoding) or + (form-data encoding used in query strings). This tool uses %20 by default, which is correct for all URL positions. The + convention only applies to the query string portion of a URL.

How do I encode a URL that contains another URL as a parameter?

When passing a URL as a query parameter value (e.g., a redirect URL), encode the inner URL with encodeURIComponent. This converts the inner URL's special characters (://?&=) to percent-encoded form so they do not interfere with the outer URL's structure. For example, https://example.com?redirect=https%3A%2F%2Fother.com%2Fpage%3Fid%3D1 correctly preserves both URLs.

How do I decode a URL with Unicode characters?

Paste the percent-encoded URL into the input and select Decode. Sequences like %E4%B8%AD%E6%96%87 are converted back to their original Unicode characters. The tool handles multi-byte UTF-8 sequences correctly, so CJK characters, accented letters, emoji, and other non-ASCII text will decode properly.

Related tools

Related guides