URL Encode / Decode
Encode or decode URLs with component vs full-URL mode. Parse query strings and detect malformed sequences.
Advanced — Component mode · Diagnostics On
What is URL Encode / Decode?
URL encoding converts special characters (spaces, ampersands, equals signs, etc.) into percent-encoded format so they can be safely used in URLs. For example, a space becomes %20 and & becomes %26. This is essential when building query strings, passing API parameters, or including user input in links. Without encoding, special characters can break URLs or cause security issues.
ToolCrux offers two modes: Component mode (encodeURIComponent) encodes everything except unreserved characters—use it for individual query parameter values. Full-URL mode (encodeURI) preserves URL structure characters like ://, ?, and # so complete URLs stay navigable. The built-in query parser breaks URLs into protocol, host, path, and parameters for easy inspection and debugging.
How to Use URL Encode / Decode
- Switch to the Encode or Decode tab.
- Paste your text or encoded URL into the input area.
- For encoding: choose Component mode (query values) or Full URL mode (complete URLs) in Advanced.
- Click Encode or Decode. Use Parse URL in Decode mode to break a URL into its components.
- Enable malformed sequence diagnostics in Advanced to detect invalid percent-encoded sequences.
- Click Copy to copy the result.
Tips & Best Practices
Use Component mode when encoding a single value (e.g., search=hello world → search=hello%20world). Use Full URL mode when you have a complete URL and want to encode only path/query characters while keeping structure intact. The Use Sample button loads an example with special characters. Press Ctrl+Enter to encode/decode, Ctrl+Shift+C to copy, and Escape to clear. For HTML entities (e.g., <), use our HTML encode/decode tool; for Base64, use the Base64 encoder.
When to Use This Tool
Use URL Encode/Decode when building API URLs with dynamic parameters, debugging redirect URLs, handling form data in query strings, or working with OAuth or other auth flows that pass encoded values. Common scenarios: encoding search terms for a URL, passing JSON in a query parameter, or decoding a malformed link to fix it. Related tools: HTML encode/decode for HTML entities, Base64 encoder for binary data. All processing runs in your browser—no data is sent to any server.
Frequently Asked Questions
What is URL encoding?
URL encoding converts special characters (spaces, &, =, etc.) into percent-encoded format (e.g. %20 for space) so they can be safely used in URLs. For encoding HTML entities, try our HTML encode/decode tool.
What is the difference between component and full-URL mode?
Component mode (encodeURIComponent) encodes everything except unreserved characters. Full-URL mode (encodeURI) preserves URL structure characters like ://?#[]@!$&'()*+,;= so valid URLs stay navigable.
What is the query parser?
The query parser breaks a URL into its parts (protocol, host, path, query parameters) and displays each parameter as a key-value pair for easy inspection.
Is my input sent to a server?
No. Encoding and decoding run entirely in your browser using JavaScript. Your text is never uploaded or stored.
What characters get encoded?
In component mode, spaces become %20, & becomes %26, = becomes %3D, and other reserved/special characters are converted to their percent-encoded form. For Base64 encoding, see the Base64 encoder.
Can I detect malformed percent sequences?
Yes. The tool automatically detects and highlights malformed percent-encoded sequences (like %GG or lone % signs) and shows diagnostic warnings.