Data Converter icon

Data Converter

Convert between various data formats - Base64, Binary, JSON, XML, YAML, CSV, HTML, and more

Overview

The node's Parse Data URL operation under the Base64 resource extracts and decodes data embedded within a Data URL string. A Data URL typically embeds small files inline in documents using a URI scheme like data:[<mediatype>][;base64],<data>. This operation parses such URLs to retrieve the raw data content.

This is useful when you receive or handle data encoded as Data URLs (e.g., images, files, or other media embedded directly in HTML or JSON) and want to extract the actual binary or textual content for further processing or storage.

Practical examples:

  • Extracting an image file from a Data URL to save it as a binary file.
  • Decoding embedded base64 text data from a Data URL for analysis or transformation.
  • Processing inline SVG or other media embedded as Data URLs in web scraping or automation workflows.

Properties

Name Meaning
Input Data The Data URL string to parse and extract data from.
Binary Property Name (Optional) The name of the output binary property if the extracted data is returned as binary. Defaults to "data".

Output

  • The output JSON contains the extracted data from the Data URL.
  • If the node is configured to output binary data (via an additional parameter not shown here but supported generally), the extracted data will be provided as binary under the specified binary property name.
  • Otherwise, the extracted data is returned as a string in the JSON output under the result field.

Dependencies

  • No external services or API keys are required.
  • The node relies on internal utility functions for Base64 and Data URL parsing.
  • No special environment variables or n8n configurations are necessary.

Troubleshooting

  • Invalid Data URL format: If the input string is not a valid Data URL, the node may throw an error indicating parsing failure. Ensure the input strictly follows the data:[<mediatype>][;base64],<data> format.
  • Empty or missing input: Providing empty input will result in no meaningful output. Always supply a valid Data URL string.
  • Binary output issues: If outputting binary data, ensure the binary property name is correctly set and downstream nodes expect binary data.
  • Encoding errors: If the embedded data is not base64 encoded but the node expects it, decoding may fail. Verify the encoding part of the Data URL.

Links and References

Discussion