URL Encoder / Decoder
Encode or decode URLs and URL components instantly. Convert special characters to percent-encoded values, decode encoded text and work with URI components or form-style query data directly in your browser.
Encode or Decode URLs
Convert URL components, complete URIs or form-encoded data using browser-native encoding methods.
Current Method
Encodes an individual URL component using JavaScript encodeURIComponent().
Shortcut: Ctrl/Cmd + Enter to convert
Conversion Details
Inspect the selected conversion type and size of the input and output.
Operation
Encode
Method
URL Component
Input Bytes
0
Output Bytes
0
Which Encoding Type Should I Use?
The correct method depends on whether you are encoding a complete URL or only one value inside it.
URL Component
Best for an individual query value, path value or other piece of a URL.
Input
Research & Development
Output
Research%20%26%20Development
Full URL / URI
Best when you already have a complete URL and want to preserve its structure.
Input
https://example.com/search?q=Laravel tools
Output
https://example.com/search?q=Laravel%20tools
Form Encoding
Useful for application/x-www-form-urlencoded form and query-style values.
Input
Michael Smith
Output
Michael+Smith
Common Percent-Encoded Characters
Percent encoding represents encoded bytes using a percent sign followed by two hexadecimal digits.
| Character | Encoded | Common Meaning |
|---|---|---|
| Space |
%20
|
Space in ordinary percent encoding |
| & |
%26
|
Query parameter separator when unencoded |
| = |
%3D
|
Separates parameter names and values |
| ? |
%3F
|
Begins the query portion of a URL |
| # |
%23
|
Begins a URL fragment |
| / |
%2F
|
Path separator |
| : |
%3A
|
Used after URL schemes such as https |
| + |
%2B
|
Literal plus sign |
| % |
%25
|
Begins a percent-encoded sequence |
How Double Encoding Happens
Encoding the same value more than once can produce unexpected results.
Original
Laravel Tools
Encoded Once
Laravel%20Tools
Encoded Twice
Laravel%2520Tools
On the second pass, the
%
from
%20
is itself encoded as
%25.
JavaScript URL Encoding Reference
encodeURIComponent()
Use when encoding an individual value that will become part of a URL.
encodeURIComponent('Research & Development')
encodeURI()
Use when encoding a URI while preserving normal URI structure.
encodeURI('https://example.com/search?q=Laravel tools')
URL Encoding Is Not Encryption
Encoded URLs can be decoded easily. Percent encoding only changes the representation of characters so they can be used safely in URL syntax.
Passwords, API keys, authentication tokens and other secrets should not be considered protected simply because they appear percent encoded.
Encode the Value for Its Actual URL Context
A complete URL and a query parameter value are not the same thing.
For example, if an entire callback URL is being inserted as the value of a parameter in another URL, the callback URL becomes data inside the outer URL and should normally be encoded as a component.
Private Browser-Based URL Conversion
URL encoding and decoding happen directly inside your browser.
- No file upload is required.
- Input values do not need to be sent to SwiftVecto's server.
- URL Component mode uses browser-native JavaScript encoding functions.
- Full URI mode uses the browser's native URI handling.
- Form encoding is calculated locally using browser URL APIs.
Continue with These Tools
Finished using URL Encoder / Decoder? Here are some related tools that people commonly use next to complete their workflow faster.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to readable text instantly. Supports UTF-8 and Base64URL with private browser-based processing.
HTML Encoder / Decoder
Encode HTML special characters into safe entities or decode HTML entities back into readable text. Work with named, decimal and hexadecimal entities directly in your browser.
JSON Formatter & Validator
Format, beautify, minify and validate JSON online instantly. Detect invalid JSON, organise nested data and create clean, readable JSON directly in your browser.
JWT Decoder & Inspector
Decode and inspect JSON Web Tokens online. View JWT headers, payloads, claims, timestamps and expiration details instantly in your browser without uploading your token.
Regex Tester
Test JavaScript regular expressions online with live match highlighting, capturing groups, named groups, flags and replacement previews directly in your browser.
Hash Generator
Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes instantly from text. Create lowercase or uppercase hexadecimal hashes with private browser-based processing.
How to Encode and Decode URLs
Use the SwiftVecto URL Encoder / Decoder to convert text into URL-safe percent encoding or decode encoded URLs and URL components back into readable text. Choose whether you are working with an individual URL component, a complete URI or form-style query data.
Overview
URLs can contain structural characters such as :, /, ?, &, = and #, while user-provided values may contain spaces, punctuation, Unicode characters and other characters that require encoding before they can safely appear in particular parts of a URL. Percent encoding represents bytes using a percent sign followed by hexadecimal digits. For example, a space may become %20 and an ampersand may become %26 when encoded as part of a query parameter value. Different URL contexts require different treatment. Encoding an individual query value should usually escape structural characters, while encoding an entire URI should preserve characters that define the URI structure. HTML form encoding introduces another convention where spaces are commonly represented using +. The SwiftVecto URL Encoder / Decoder exposes these distinctions instead of treating all URL encoding as one operation.
Benefits
How It Works
Choose whether you want to encode or decode.
Choose the encoding context: URL Component, Full URL or Form Encoding.
Enter or paste the source text.
URL Component encoding escapes characters that could otherwise be interpreted as URL syntax.
Full URL encoding preserves important URI structure such as slashes, colons and query delimiters while encoding characters that require escaping.
Form Encoding follows application/x-www-form-urlencoded conventions and commonly represents spaces as +.
Decoding reverses the selected encoding convention.
Percent sequences are interpreted as encoded bytes and converted back into readable UTF-8 text where valid.
The converted result can be copied immediately without server-side processing.
How to Use This Tool
-
1Choose Encode or Decode.
-
2Choose URL Component when working with a query parameter value, path segment or similar individual value.
-
3Choose Full URL when you want to preserve the structure of an existing complete URI.
-
4Choose Form Encoding when working with application/x-www-form-urlencoded data.
-
5Paste or type the value you want to convert.
-
6Select Encode or Decode, or allow the browser interface to update the result automatically.
-
7Review the converted output.
-
8Copy the result when required.
-
9Use Swap to move the result back into the input for reverse testing.
-
10Clear the tool before beginning another unrelated conversion.
Helpful Tips
- Use URL Component encoding for individual query parameter values rather than encoding an entire URL as one component.
- A space normally becomes %20 with percent encoding but commonly becomes + with application/x-www-form-urlencoded form encoding.
- An ampersand & has structural meaning inside a query string, so it should be encoded as %26 when it is part of a parameter value.
- An equals sign = separates query parameter names and values, so it may also need encoding when it belongs inside a value.
- Do not repeatedly encode an already encoded value unless double encoding is intentional.
- Double encoding often turns % into %25, so %20 may become %2520.
- Decode only as many times as required to recover the intended original value.
- Use component encoding before inserting user-controlled values into dynamically constructed URLs.
- Prefer platform URL APIs such as URL and URLSearchParams when constructing complex URLs programmatically.
- Do not assume URL encoding provides encryption or protects sensitive information.
- Encoded values remain readable after decoding and may still appear in browser history, logs and server records.
- Unicode characters are encoded as their UTF-8 byte representation rather than one percent sequence per visible character.
- A complete URL and an individual URL parameter are different contexts and should not always use the same encoding function.
- In JavaScript, encodeURIComponent() is commonly appropriate for individual values while encodeURI() is designed for URI-like strings.
- Form encoding differs subtly from ordinary percent encoding, particularly around spaces and some characters.
Common Uses
Encode a search query before inserting it into a URL.
Decode a URL copied from browser developer tools.
Encode an ampersand that belongs inside a query parameter value.
Decode callback URLs received from an OAuth integration.
Inspect an encoded redirect URL.
Encode Unicode text for use inside a query parameter.
Convert spaces into percent-encoded values.
Decode %20 back into ordinary spaces.
Convert form-style + characters back into spaces.
Debug API requests containing encoded parameters.
Encode a path segment containing spaces or punctuation.
Check whether a value has accidentally been encoded twice.
Worked Examples
The following examples demonstrate how this tool can be used in realistic scenarios.
Encoding a Search Query
The text "Laravel developer tools" encoded as a URL component becomes Laravel%20developer%20tools. It can then safely be inserted as the value of a query parameter.
Encoding an Ampersand Inside a Value
The value "Research & Development" contains an ampersand. When encoded as a component, the ampersand becomes %26 so it is not mistaken for the separator between two query parameters.
Decoding Percent Encoding
The value SwiftVecto%20Developer%20Tools decodes to "SwiftVecto Developer Tools". Each %20 represents an encoded space.
Form-Style Encoding
With application/x-www-form-urlencoded encoding, the value "Michael Smith" may be represented as Michael+Smith rather than Michael%20Smith because form encoding commonly represents spaces using plus signs.
Avoiding Double Encoding
An already encoded value containing %20 should not normally be encoded again. A second encoding pass may convert the percent sign to %25, turning %20 into %2520.
Common Mistakes
Avoid these common mistakes to achieve the most accurate results.
- Encoding an entire URL with component encoding and unintentionally escaping structural characters such as : and /.
- Using full-URI encoding for a query value that contains reserved characters which should have been escaped.
- Assuming + always means a space in every URL context.
- Forgetting that + is specifically significant when decoding application/x-www-form-urlencoded data.
- Encoding the same value twice accidentally.
- Decoding a value repeatedly without knowing how many encoding layers were applied.
- Assuming percent encoding is encryption.
- Putting sensitive credentials into a URL because the value looks unreadable after encoding.
- Failing to encode & when it belongs inside a query parameter value.
- Failing to encode # when it belongs to data rather than being intended as a URL fragment delimiter.
- Manually concatenating complex URLs when a URL API would provide safer parameter handling.
- Expecting URL encoding and HTML entity encoding to solve the same problem.
- Assuming every percent sign begins a valid encoded sequence.
- Trying to decode malformed percent sequences such as %ZZ.
- Ignoring Unicode and UTF-8 when debugging percent-encoded non-ASCII text.
Glossary
Definitions of the most important terms used by this tool.
URL
Uniform Resource Locator, an address identifying the location of a resource and the protocol used to access it.
URI
Uniform Resource Identifier, a broader identifier concept that includes URLs and other URI forms.
Percent Encoding
A representation where encoded bytes are written using % followed by two hexadecimal digits, such as %20 for a space byte.
URL Component
An individual part of a URL such as a query parameter value, path segment, hostname, fragment or parameter name.
Reserved Character
A character that has structural meaning within URI syntax, such as :, /, ?, #, [ ], @, !, $, &, apostrophe, parentheses, *, +, comma, semicolon or = depending on context.
Unreserved Character
Characters generally safe to appear without percent encoding in URI components, including ASCII letters, digits, hyphen, period, underscore and tilde.
Query String
The portion of a URL following ?, commonly containing name-value parameters separated by &.
Query Parameter
A name-value pair carried in the query portion of a URL.
Fragment
The portion of a URL following #, commonly identifying a location or client-side state within the referenced resource.
UTF-8
A widely used Unicode character encoding used when converting non-ASCII text into bytes for percent encoding.
encodeURIComponent()
A JavaScript function commonly used to percent-encode an individual URI component while escaping characters that could otherwise have structural meaning.
decodeURIComponent()
A JavaScript function that reverses encoding performed for an individual URI component.
encodeURI()
A JavaScript function intended for encoding a URI while preserving many characters that form part of its structure.
decodeURI()
A JavaScript function that decodes URI encoding while respecting characters reserved for URI syntax.
Form Encoding
The application/x-www-form-urlencoded convention used for many HTML form submissions and query-style key-value payloads.
Double Encoding
Encoding data that has already been encoded, often causing percent signs to become %25 and making the value require multiple decoding passes.
Frequently Asked Questions
What is URL encoding?
URL encoding represents characters using URI-safe forms, commonly percent sequences such as %20 or %26. This prevents data characters from being confused with characters that control URL structure.
What is URL decoding?
URL decoding reverses percent encoding so encoded values such as %20 are converted back into their original characters.
What does %20 mean in a URL?
%20 is the percent-encoded representation commonly used for a space character in UTF-8 URL encoding.
Why does a space sometimes become + instead of %20?
HTML form and application/x-www-form-urlencoded encoding commonly represents spaces using +. Ordinary percent encoding commonly represents a space as %20.
What does %26 mean?
%26 represents an encoded ampersand. This is especially useful when an ampersand belongs inside a query parameter value rather than separating two parameters.
What does %3D mean?
%3D is the percent-encoded representation of the equals sign =.
What does %3F mean?
%3F represents the question mark ?. A literal question mark inside data may need encoding so it is not interpreted as URI syntax.
What does %23 mean?
%23 represents the # character. Encoding it may be necessary when # belongs to data rather than marking a URI fragment.
What is the difference between URL Component and Full URL encoding?
Component encoding is intended for individual values and escapes more reserved characters. Full URL or URI encoding preserves many structural characters such as :, /, ? and # so the overall URI structure remains intact.
Should I use component encoding for query parameters?
For an individual parameter value, component-style encoding is usually the appropriate choice because characters such as &, = and # could otherwise alter the structure of the URL.
What is encodeURIComponent()?
encodeURIComponent() is a JavaScript function used to encode an individual URI component. It is commonly appropriate when encoding query parameter values or other individual pieces of a URL.
What is encodeURI()?
encodeURI() is a JavaScript function intended to encode a URI while preserving many characters that define the URI structure.
Why should I not encode an entire URL with encodeURIComponent()?
Component encoding also escapes structural characters. Applying it to a complete URL can therefore encode characters such as : and / and turn the whole URL into one encoded value rather than preserving its URL structure.
What is application/x-www-form-urlencoded?
It is a key-value encoding convention widely used by HTML forms and query-style requests. Among its behaviours, spaces are commonly represented using +.
Does URL encoding encrypt data?
No. URL encoding is a reversible representation format, not encryption. Anyone can decode the value.
Is it safe to put passwords or API keys in an encoded URL?
URL encoding does not make sensitive information secret. URLs may appear in logs, browser history, analytics systems and other locations, so sensitive credentials should generally not be placed in URLs merely because they are encoded.
What is double URL encoding?
Double encoding occurs when an already encoded value is encoded again. For example, %20 can become %2520 because the % character itself is encoded as %25.
How do I decode a double-encoded URL?
A genuinely double-encoded value generally requires two decoding passes. However, do not repeatedly decode arbitrary input without confirming how many encoding layers were intentionally applied.
Can URL encoding handle Unicode characters?
Yes. Unicode text is commonly converted to UTF-8 bytes and those bytes are represented using percent encoding where required.
Is URL encoding the same as Base64?
No. Percent encoding is designed around URI syntax and represents particular bytes using %XX sequences. Base64 is a different binary-to-text encoding scheme.
Is URL encoding the same as HTML encoding?
No. URL encoding addresses URI syntax, while HTML encoding or entity escaping addresses characters interpreted specially by HTML. A value may require different handling depending on where it is inserted.
Can I encode an entire callback URL as a query parameter?
Yes. If a complete callback URL is itself being placed inside another URL as one query parameter value, that callback URL should normally be encoded as a component because it is data within the outer URL.
Does SwiftVecto send the value I enter to the server?
The interactive URL Encoder / Decoder is designed to perform normal encoding and decoding directly inside your browser.
Is the URL Encoder / Decoder free?
Yes. SwiftVecto provides this developer utility for encoding and decoding URLs, URI components and form-style data.
Things to Know
- URL Component mode corresponds conceptually to JavaScript encodeURIComponent() and decodeURIComponent().
- Full URL mode corresponds conceptually to JavaScript encodeURI() and decodeURI().
- Form Encoding mode follows application/x-www-form-urlencoded-style space handling.
- Component encoding is generally the safer choice for an individual query parameter value.
- Percent encoding operates on encoded bytes rather than directly on visual characters.
- Unicode text is encoded using UTF-8 in the browser implementation.
- Decoding malformed percent sequences should produce a clear validation error rather than silently corrupting the input.
- Normal interactive encoding and decoding is intended to happen directly inside the browser.
Disclaimer
URL encoding is not encryption and should not be used as a method for protecting sensitive information.
Different frameworks and APIs may apply URL encoding automatically, so developers should avoid adding an unnecessary second encoding layer.
The correct encoding method depends on where the value appears within the URL or request.
Users remain responsible for testing encoded values against the behaviour expected by their target framework, API or service.
Official References
The following official resources were used when developing this tool and are useful for further reading.
MDN Web Docs - encodeURIComponent()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
MDN Web Docs - decodeURIComponent()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent
MDN Web Docs - encodeURI()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI
WHATWG URL Standard
https://url.spec.whatwg.org/