URL Encode

Encode text for safe use in URLs — paste, encode, and copy instantly.

Input Text
Output URL Encoded
Encoded URL will appear here...
info

About URL Encode

URL Encode is a free online tool that converts raw text and special characters into percent-encoded format that is safe to include in a URL. Characters like spaces, ampersands, quotes, and non-ASCII letters cannot appear literally in a URL without breaking it. This tool replaces each unsafe character with a percent sign followed by the two-digit hexadecimal code for that byte — for example, a space becomes %20 and a plus sign becomes %2B.

The tool provides two distinct encoding modes that match the two standard JavaScript functions. Component mode uses encodeURIComponent(), which encodes every character that is not a letter, digit, or one of the unreserved symbols - _ . ! ~ * ' ( ). This is the right choice when encoding a single query parameter value or a form field before appending it to a URL. Full URI mode uses encodeURI(), which leaves the structural characters :, /, ?, #, [, ], @, !, $, &, ', (, ), *, +, ,, ;, and = untouched so that an already-formed URL keeps its shape. Use Full URI mode when you have a complete URL that may contain non-ASCII characters in the path or query string.

Every encoding operation runs entirely inside your browser using the native JavaScript encodeURIComponent and encodeURI functions — no text is transmitted to any server. That means passwords, API keys, private endpoint paths, and any other sensitive query data stay on your own machine. The tool is free to use without a sign-up, and there are no rate limits or character length caps.

star

Key Features

check_circle

Two encoding modes in one tool

Switch between Component mode (encodeURIComponent) for individual query values and Full URI mode (encodeURI) for complete URLs without leaving the page.

check_circle

100% client-side processing

Encoding runs in the browser using native JavaScript. Your text, API keys, and query parameters are never uploaded or logged anywhere.

check_circle

Handles non-ASCII and Unicode

Multi-byte characters such as accented letters, CJK characters, and emoji are correctly converted to their UTF-8 percent-encoded sequences, which is the format all modern web servers expect.

check_circle

Accurate to RFC 3986

The underlying encodeURIComponent and encodeURI functions follow the W3C and IETF percent-encoding specification, so the output is accepted by any standards-compliant HTTP client or server.

check_circle

Instant one-click copy

Copy the encoded result to your clipboard with a single button and paste it directly into a URL builder, terminal curl command, or API request.

check_circle

Clear and reset in one click

The delete button wipes both the input and output fields simultaneously so you can start a fresh encoding without manually selecting and deleting text.

help

How to Use

01

Enter Text

Type or paste the text or URL you want to encode into the input pane.

02

Select Mode

Choose Component mode for query values or Full URI mode for complete URLs.

03

Encode & Copy

Click "Encode" to convert your text, then copy the result.

code_blocks

Example

A search query with spaces, a special character, and a non-ASCII letter is encoded in Component mode. Each unsafe character becomes its percent-encoded equivalent so the string can be safely appended to a URL as a query parameter value.

Raw query value (Component mode)
café & bakery open now?
Percent-encoded output
caf%C3%A9%20%26%20bakery%20open%20now%3F
lightbulb

Common Use Cases

  • arrow_circle_right

    Building API query strings by hand

    When constructing a REST API request manually — in a terminal, a Postman-style client, or a script — Component mode encodes each parameter value so that ampersands and equals signs in the value itself do not break the query string parser on the server.

  • arrow_circle_right

    Encoding redirect and callback URLs

    OAuth flows, single sign-on providers, and payment gateways accept a return_url or callback_url parameter. The entire destination URL must be percent-encoded before it can be embedded as a query value, which is exactly what Component mode produces.

  • arrow_circle_right

    Fixing non-ASCII characters in internationalized URLs

    Paths containing accented letters or CJK characters often work in the browser address bar but fail in HTTP libraries or curl. Full URI mode converts those characters to valid percent-encoded sequences while leaving the rest of the URL intact.

  • arrow_circle_right

    Sanitizing user-supplied URL fragments before concatenation

    If your code concatenates a user-entered search term or file name directly into a URL string, a raw ampersand or hash character in that value will silently corrupt the URL. Encode the value first with this tool to verify what the output should look like before writing the encoding logic.

  • arrow_circle_right

    Preparing mailto links with pre-filled subject and body

    The subject and body parameters in a mailto: link must be percent-encoded so that spaces, newlines, and punctuation in the message text are correctly interpreted by the mail client. Component mode handles this encoding in one step.

quiz

Frequently Asked Questions

What is URL encoding? expand_more
URL encoding, also called percent-encoding, replaces characters that are not allowed or have special meaning in a URL with a percent sign followed by the two-digit hexadecimal code for that byte. For example, a space becomes %20, an ampersand becomes %26, and the euro sign becomes %E2%82%AC.
What is the difference between Component mode and Full URI mode? expand_more
Component mode uses encodeURIComponent(), which encodes every character except letters, digits, and - _ . ! ~ * ' ( ). Use it when encoding a single query parameter value or form field. Full URI mode uses encodeURI(), which additionally preserves the structural characters :, /, ?, #, [, ], and @ so that a complete, already-formed URL keeps its navigable shape. If you encode a full URL with Component mode, the slashes and question marks in it will be encoded too, breaking the URL.
How is URL encoding different from Base64 encoding? expand_more
URL encoding converts each unsafe byte to a %XX sequence and is designed specifically so the result can be used inside a URL. Base64 encoding converts arbitrary binary data into a string of 64 printable ASCII characters and is designed for embedding binary data in text contexts like email or JSON. Base64 output contains + and / which themselves need URL encoding if placed in a query string. Use URL encoding when building URLs, and use the separate Base64 Encode tool for binary or credential payloads.
How is this tool different from HTML Encode? expand_more
URL Encode produces percent-encoded output (e.g. %26 for an ampersand) intended for use inside URLs and query strings. HTML Encode produces HTML entity output (e.g. & for an ampersand) intended for safely displaying text inside an HTML document. The two formats are not interchangeable — putting HTML entities in a URL will not work, and putting percent-encoded strings in HTML will display as literal %26 rather than rendering the character.
Is my data sent to a server? expand_more
No. Every encoding operation runs in your browser using the native JavaScript encodeURIComponent and encodeURI functions. Nothing is transmitted anywhere. Sensitive values like API keys, passwords, and private endpoint paths never leave your machine.
Does the tool handle Unicode and emoji? expand_more
Yes. The JavaScript encoding functions convert each Unicode character to its UTF-8 byte sequence first, then percent-encode each byte. An emoji like the thumbs-up (U+1F44D) becomes %F0%9F%91%8D, which is the correct encoding expected by all modern HTTP servers.
Why does a space sometimes become + instead of %20? expand_more
In the application/x-www-form-urlencoded format used by HTML forms, spaces are encoded as + for historical reasons. The W3C URI standard and this tool always use %20 for spaces. %20 is safe everywhere; the + shorthand is only valid in the query string of a form submission and is not recognized as a space by all URL parsers.
Is there a limit on how much text I can encode? expand_more
There is no fixed limit. Because encoding runs locally in your browser, you can process query strings of any length. Very large inputs may be slow depending on your device, but there is no server-imposed cap.