UtilitySansar
Encoding

URL Encode

Percent-encode text so it can be dropped safely into a URL, query string, or form field without breaking the surrounding structure. Switch between component and full-URL modes with live output.

  • Published
  • Last reviewed

Tool Summary Answer Block

This tool accepts structured input and returns deterministic output in the browser with no server upload.

Tool name
URL Encode
Input intent
Provide source content to transform, validate, or analyze.
Output intent
Receive normalized output suitable for copy, reuse, or debugging.
Example input
hello world & friends
Example output
hello%20world%20%26%20friends
0characters0escaped

Component mode (encodeURIComponent) escapes every reserved character — use it for a single query value or path segment.

Already encoded? Switch to URL Decode

Tool Introduction

Percent-encode text so it can be dropped safely into a URL, query string, or form field without breaking the surrounding structure. Switch between component and full-URL modes with live output.

Tool Overview

URLs reserve a small set of characters for structural meaning (?, &, =, /, #, and others). When you want to put arbitrary text inside a URL — a search query, a path segment, a tracking parameter — you must percent-encode the reserved and non-ASCII characters so each unsafe byte becomes %XX. This tool offers two modes. Component mode wraps encodeURIComponent and escapes every reserved character, which is what you want for a single query value or path segment. Full-URL mode wraps encodeURI and leaves structural characters like :/?#& intact, so you can encode a whole address that contains spaces or Unicode. Non-ASCII text is encoded as UTF-8 first, so accents and emoji are handled correctly. Everything runs in your browser.

Use Cases

  • Build a query parameter that contains spaces, ampersands, or symbols
  • Encode a search term before appending it to an API endpoint
  • Prepare a redirect or return URL passed as a query-string value
  • Escape a path segment that includes reserved characters
  • Encode UTM campaign values so analytics links stay valid

Input/Output Examples

Component mode escapes the spaces and the ampersand.
Input Intent
hello world & friends
Output Intent
hello%20world%20%26%20friends
Full-URL mode keeps the :// ? = structure but encodes spaces and accents.
Input Intent
https://example.com/search?q=cafés & bars
Output Intent
https://example.com/search?q=caf%C3%A9s%20&%20bars

FAQ

What is the difference between encodeURIComponent and encodeURI?+
encodeURIComponent (Component mode) escapes reserved URL characters too, so it is safe for any single value. encodeURI (Full URL mode) leaves structural characters like :/?#& alone so a complete URL stays usable. Pick Component for one parameter, Full URL for a whole address.
When should I URL-encode text?+
Whenever you put user-supplied or arbitrary text into a URL: query parameter values, path segments, fragment identifiers, or application/x-www-form-urlencoded bodies.
How are spaces encoded?+
Spaces become %20. In some form-encoding contexts a space is written as +; if your target expects that, replace %20 with + after encoding.
Does it handle emoji and non-English characters?+
Yes. Characters are encoded as UTF-8 first, so accented letters, emoji, and non-Latin scripts produce valid multi-byte %XX sequences.

Explore More Tools

Discover related utilities in the Encoding category below.

Browse all Encoding

Related tools

Handpicked utilities you might find useful