Encode text for safe use in URLs. Spaces become %20, special characters are percent-encoded.
URL-encoded output
Hello%2C%20World!%20%F0%9F%8C%8D
URL encoding converts special characters and spaces into percent-encoded format (e.g., space becomes %20). This is essential when embedding text in URLs.
Share
What is the URL Encoder?
URL encoding (also called percent encoding) is a standardized method for representing characters in URLs by converting unsafe symbols into %HH sequences, where HH is the hexadecimal code of the character. This ensures text can be transmitted safely through web browsers and APIs without breaking links or causing parsing errors.
How it works
The tool reads your input text and converts each special character—spaces, ampersands, hyphens, Unicode characters—into its UTF-8 byte representation, then expresses each byte as %HH in hexadecimal. Alphanumeric characters (A-Z, a-z, 0-9) and safe symbols (hyphen, underscore, tilde, period) pass through unchanged. The encoded output is copy-ready for query strings, form submissions, and API calls.
Each unsafe character is converted to its UTF-8 byte value and represented in hexadecimal with a % prefix. For example, space (ASCII 32) becomes %20, and & becomes %26.
Examples
Input
Result
Notes
hello world
hello%20world
Space becomes %20, the most common encoded character in URLs
user@example.com
user%40example.com
@ symbol becomes %40, essential for email parameters in query strings
Click the 'Encode' button or the tool encodes automatically
Copy the encoded URL-safe text from the output box
Paste it into your query parameter, form field, or API request
Use it in URLs like https://example.com?search=encoded-text
Benefits
Prevent broken links by safely encoding spaces and symbols in URLs
Build valid query strings and form submissions without syntax errors
Enable sharing of special characters in social media and messaging without corruption
Simplify API requests by encoding user input data correctly
Ensure cross-platform compatibility across browsers and servers
Tips & common mistakes
Common mistakes
Encoding already-encoded text (double-encoding) results in %25XX sequences that won't decode correctly
Using spaces instead of %20 in URLs causes parsing failures and truncation in some systems
Forgetting to encode query parameters leads to & or = symbols breaking the URL structure
Tips
Always encode user input before adding it to URLs to prevent injection attacks and broken links
Use URL decoding (the reverse) to verify your encoding and troubleshoot unexpected results
Only the parameter values need encoding; the base URL and parameter names are typically already safe
Frequently asked questions
Why is my URL broken after encoding?
You likely encoded the entire URL including the protocol and domain. Encode only the parameter values and path segments, not https:// or the domain name.
What's the difference between URL encoding and HTML encoding?
URL encoding escapes characters for safe use in URLs (spaces → %20), while HTML encoding escapes for safe display in HTML (< → <). They serve different purposes.
Does URL encoding encrypt or hide my data?
No. URL encoding is purely a format conversion for safe transmission—it's easily reversed. Use HTTPS to encrypt sensitive data in URLs.
Which characters must be encoded in URLs?
Spaces, special symbols (&, #, %, @, =, +, ?, :, /), and non-ASCII characters must be encoded. Safe characters (A-Z, 0-9, -, _, ., ~) do not require encoding.
Can I encode Unicode characters like emoji or accents?
Yes. Unicode characters are converted to UTF-8 bytes, then each byte is percent-encoded. For example, é becomes %C3%A9.
What is the maximum length of an encoded URL?
URLs have a practical limit of 2,000–8,000 characters depending on the browser and server. Encoding increases length (each special char becomes 3+ characters), so very long text may exceed limits.