Url Decode
Decodes a URL encoded string back to its original format.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
Inputs
- Encoded Url - The URL encoded string to decode. Cannot be empty.
Options
This node does not have any options.
Outputs
- Result - The decoded plain text string.
How It Works
The Url Decode node converts URL encoded strings back to their original text format. When executed, the node:
- Receives a URL encoded string through the Encoded Url input
- Decodes percent-encoded characters (e.g.,
%20to space) - Converts
+characters to spaces - Outputs the decoded string through the Result output
This node is the reverse operation of Url Encode and is essential for processing URL parameters and query strings.
Example Usage
Example 1: Decoding Query Parameters
Decode URL parameters extracted from a web request:
// Input: "hello+world"
// Output: "hello world"
// Input: "user%40example.com"
// Output: "user@example.com"
Example 2: Decoding Complex Parameters
Decode URL parameters with special characters:
// Input: "name%3DJohn+Doe%26email%3Djohn%40example.com"
// Output: "name=John Doe&email=john@example.com"
Example 3: Decoding Search Queries
Decode search terms from URL:
// Input: "RPA+automation+%26+testing"
// Output: "RPA automation & testing"
Example 4: Decoding Non-ASCII Characters
Decode international characters:
// Input: "%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82+%D0%BC%D0%B8%D1%80"
// Output: "Приве т мир"
// Input: "%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF"
// Output: "こんにちは"
Requirements
- Valid URL encoded string as input
- Input string must not be empty
Error Handling
The node will return specific errors in the following cases:
- ErrInvalidArg - When the input string is empty
- ErrInvalidArg - When the URL encoding is invalid (e.g., malformed percent sequences)
Usage Tips
- Extract Parameters: Decode query parameters extracted from URLs
- Process Form Data: Decode form submissions in application/x-www-form-urlencoded format
- Web Scraping: Decode URLs and parameters when scraping web content
- API Integration: Decode URL-encoded data from API responses
- Pair with Encode: Use this to reverse Url Encode operations
- Validation: Verify decoded content matches expected format
Common Use Cases
- URL Parameter Processing: Decode query string parameters from HTTP requests
- Form Data Handling: Process URL-encoded form submissions
- Link Extraction: Decode URLs extracted from web pages
- API Response Processing: Decode URL-encoded fields in API responses
- Web Scraping: Extract and decode search queries or filters from URLs
- Webhook Processing: Decode URL-encoded data from webhook callbacks
Decoding Rules
%XXsequences are decoded to their corresponding characters+is decoded to space- Alphanumeric characters and
-_.~remain unchanged - Multiple
%XXsequences are processed in order
Best Practices
- Validation: Always validate the decoded output format
- Error Handling: Use "Continue On Error" when processing potentially malformed URLs
- Security: Sanitize decoded data before using it in operations
- Encoding Verification: Check if the input is actually URL encoded
- Character Encoding: Ensure proper UTF-8 handling for international characters
Common Errors and Solutions
Invalid URL Encoding
Problem: Error message "Invalid URL encoding"
Solutions:
- Check for incomplete percent sequences (e.g.,
%2instead of%20) - Verify percent signs are followed by two hexadecimal digits
- Remove or encode standalone
%characters - Ensure the string is actually URL encoded
Empty Input
Problem: Error message "Encoded URL cannot be empty"
Solutions:
- Verify the input variable contains data
- Check if the previous node properly set the output
- Add conditional logic to handle empty values
Unexpected Characters
Problem: Decoded output contains unexpected characters
Solutions:
- Verify the input was properly URL encoded
- Check for double-encoded values that need multiple decode operations
- Ensure character encoding (UTF-8) is consistent throughout the flow
- Validate that the percent sequences are correct
Partial Decoding
Problem: Some characters remain encoded in output
Solutions:
- Check if the input is double-encoded (requires multiple decode operations)
- Verify all percent sequences are properly formatted
- Ensure you're using Url Decode, not Base64 Decode
Example Workflow
Extracting and decoding parameters from a URL:
// Step 1: Extract query string from URL
const fullUrl = "https://example.com/search?q=RPA+%26+automation&category=software%2Ftools";
const queryString = "q=RPA+%26+automation&category=software%2Ftools";
// Step 2: Split parameters
const params = {
q: "RPA+%26+automation",
category: "software%2Ftools"
};
// Step 3: Decode each parameter value using Url Decode node
// Input: "RPA+%26+automation"
// Output: "RPA & automation"
// Input: "software%2Ftools"
// Output: "software/tools"
// Step 4: Use decoded values
const searchTerm = "RPA & automation";
const categoryPath = "software/tools";
Handling Edge Cases
Double-Encoded Values
If a value has been encoded multiple times:
// Single encode: "hello world" → "hello+world"
// Double encode: "hello+world" → "hello%2Bworld"
// To decode double-encoded value:
// First decode: "hello%2Bworld" → "hello+world"
// Second decode: "hello+world" → "hello world"
Mixed Encoding
Sometimes URLs contain both encoded and non-encoded parts:
// Input: "hello+world&name=John"
// The decoder will handle both:
// Output: "hello world&name=John"
Decoding Common Characters
| Encoded | Decoded |
|---|---|
%20 or + | (space) |
%21 | ! |
%23 | # |
%24 | $ |
%26 | & |
%27 | ' |
%28 | ( |
%29 | ) |
%2A | * |
%2B | + |
%2C | , |
%2F | / |
%3A | : |
%3B | ; |
%3D | = |
%3F | ? |
%40 | @ |
%5B | [ |
%5D | ] |
Security Considerations
- Input Validation: Always validate decoded output before using it
- SQL Injection: Sanitize decoded values before using in database queries
- XSS Prevention: Escape decoded values before displaying in web pages
- Path Traversal: Check for malicious paths like
../in decoded URLs - Command Injection: Don't use decoded values directly in system commands
Notes
- URL decoding is the reverse of URL encoding
- The decoding follows RFC 3986 specification
- Both
+and%20are decoded to space - Invalid percent sequences will cause an error
- The decoded output preserves the original character encoding (UTF-8)
- This node is NOT for decryption - it only reverses URL encoding
- Always sanitize and validate decoded data before using it in security-sensitive operations