WebToolBox

URL Encode

Try the free URL Encode tool in the Encoding category provided by WebToolBox right in your browser. Process your tasks quickly and securely without any installation.

Input

Output

What is URL Percent-Encoding (RFC 3986) and Why is It Required?

URL encoding (officially termed Percent-Encoding, RFC 3986) is the standard mechanism for converting characters that are disallowed or syntactically reserved within a Uniform Resource Identifier (URI) into a safe '%XX' hexadecimal format.

The official URI specification defines a narrow subset of safe 'unreserved characters': alphanumeric ASCII characters (A-Z, a-z, 0-9) and four punctuation symbols (hyphen '-', underscore '_', period '.', and tilde '~').

Any character outside this set—such as whitespace, reserved delimiters (?, &, =, /, #), emojis, and non-ASCII multilingual scripts—must be percent-encoded to prevent URL parameter parsing errors or server-side truncation.

입출력 예시 (Examples)

입력 (Input)결과 (Output)설명
hello worldhello%20worldStandard percent-encoding for space
user=john&role=adminuser%3Djohn%26role%3DadminEncoding reserved delimiters in query values
https://example.comhttps%3A%2F%2Fexample.comEncoding a full URL as a parameter value
cafécaf%C3%A9UTF-8 multi-byte accented character encoding

JavaScript Encoding Functions Comparison

FunctionTarget ScopePreserved Delimiters (Unencoded)Optimal Use Case
encodeURI()Full URL / Link; , / ? : @ & = + $ #Validating full hyperlinks and addresses
encodeURIComponent()Individual parameters- _ . ! ~ * ' ( )Query string keys, values, and redirect targets
escape() (Deprecated)Non-ASCII chars@ * _ + - . /Obsolete; do not use in modern projects

How to Use the Online URL Encoder

  1. Enter or paste the string you need to encode into the input box above.
  2. The tool immediately encodes characters into safe percent-encoded hex codes.
  3. Click the 'Copy' button to copy the encoded string to your clipboard.
  4. Use the 'URL Decode' tool from the navigation menu whenever you need to reverse the process.

Developer Best Practices & Implementation Tips

  • Avoid Double Encoding: Encoding an already-encoded string turns '%' into '%25', resulting in malformed strings like '%2520'.
  • Spaces: '%20' vs '+': Standard RFC 3986 URIs mandate '%20' for spaces in paths and query strings. The '+' symbol is strictly reserved for legacy HTML form payloads (application/x-www-form-urlencoded).
  • Unicode Standard (UTF-8): All modern web percent-encoding must be derived from UTF-8 byte sequences.

프로그래밍 언어별 사용 예제 (Code Examples)

JavaScript / TypeScriptjavascript
// Correctly encode query parameters
const param = encodeURIComponent('John Doe & Sons');
const url = `https://api.example.com/search?q=${param}`;
console.log(url); // https://api.example.com/search?q=John%20Doe%20%26%20Sons
Python 3 urllibpython
import urllib.parse

query = "John Doe & Sons"
encoded = urllib.parse.quote(query)
print(encoded) # John%20Doe%20%26%20Sons

FAQ (자주 묻는 질문)

Are URL encoding and percent-encoding the same thing?
Yes. They are identical terms. 'Percent-encoding' refers to the specific representation using a percent sign (%) followed by two hexadecimal digits representing the byte value.
Why does a space become '%20' in some places and '+' in others?
According to standard RFC 3986 URI specifications, a space is always '%20'. The '+' representation is an older convention specific to application/x-www-form-urlencoded HTML form submissions.
What happens if I don't URL encode query parameters?
Characters like '&' or '=' will be misinterpreted as query parameter delimiters, causing truncated inputs, server parsing failures, or 400 Bad Request errors.
Does this tool support emojis and non-English scripts?
Yes. All UTF-8 multi-byte characters are accurately transformed into standard RFC-compliant percent sequences.
Is any data sent to external servers?
No. All operations run entirely within your local browser sandbox via JavaScript. No data is stored or logged.

Encoding — Tool Navigation