Web Data Convertor
Convert between common web data formats including JSON, CSV, XML, YAML, HTML, Markdown, query strings, and Unix timestamps.
Actions
convert-unix-to-date
Convert a Unix timestamp to a human-readable date string.
Required fields:
action:"convert-unix-to-date"timestamp(integer): Unix timestamp in seconds since epoch
Optional fields:
timezone(string): IANA timezone name. Default:"UTC". Examples:"America/New_York","Europe/London","Asia/Tokyo"
Returns: ISO format date, readable date string, and timezone used.
Example:
{
"action": "convert-unix-to-date",
"timestamp": 1700000000,
"timezone": "America/New_York"
}
convert-date-to-unix
Convert a date string to a Unix timestamp.
Required fields:
action:"convert-date-to-unix"date_string(string): Date string to convert
Optional fields:
format(string): Python strftime format string for parsing. If omitted, common formats are tried automatically.
Supported auto-detected formats: YYYY-MM-DD HH:MM:SS, YYYY-MM-DD, YYYY/MM/DD HH:MM:SS, YYYY/MM/DD, DD-MM-YYYY HH:MM:SS, DD-MM-YYYY, DD/MM/YYYY HH:MM:SS, DD/MM/YYYY
Example:
{
"action": "convert-date-to-unix",
"date_string": "2024-11-14 22:13:20"
}
Example with custom format:
{
"action": "convert-date-to-unix",
"date_string": "14-Nov-2024 10:30 PM",
"format": "%d-%b-%Y %I:%M %p"
}
convert-json-to-csv
Convert a JSON object or array of objects to CSV format.
Required fields:
action:"convert-json-to-csv"json_text(string): Valid JSON string (object or array of objects)
Notes: A single object is treated as a one-row CSV. All unique keys across objects become CSV column headers, sorted alphabetically.
Example:
{
"action": "convert-json-to-csv",
"json_text": "[{\"name\":\"Alice\",\"age\":30},{\"name\":\"Bob\",\"age\":25}]"
}
convert-csv-to-json
Convert CSV text to a JSON array of objects.
Required fields:
action:"convert-csv-to-json"csv_text(string): CSV string with a header row
Notes: The first row is used as field names. Numeric values are automatically converted to numbers.
Example:
{
"action": "convert-csv-to-json",
"csv_text": "name,age,city\nAlice,30,NYC\nBob,25,LA"
}
convert-xml-to-json
Convert an XML string to JSON.
Required fields:
action:"convert-xml-to-json"xml_text(string): Valid XML string
Notes: XML attributes are stored under @attributes. Text content is stored under #text. Repeated child elements with the same tag become arrays.
Example:
{
"action": "convert-xml-to-json",
"xml_text": "<users><user id=\"1\"><name>Alice</name></user><user id=\"2\"><name>Bob</name></user></users>"
}
convert-json-to-xml
Convert a JSON string to XML format.
Required fields:
action:"convert-json-to-xml"json_text(string): Valid JSON string
Notes: If the JSON has a single top-level key, that key becomes the root element. Otherwise, a <root> element wraps the content. Use @attributes and #text keys to control XML attributes and text content.
Example:
{
"action": "convert-json-to-xml",
"json_text": "{\"book\":{\"@attributes\":{\"id\":\"1\"},\"title\":\"Example\",\"author\":\"Jane\"}}"
}
convert-markdown-to-html
Convert Markdown text to HTML.
Required fields:
action:"convert-markdown-to-html"markdown_text(string): Markdown content to convert
Notes: Supports standard Markdown, code blocks, tables, and fenced code blocks.
Example:
{
"action": "convert-markdown-to-html",
"markdown_text": "# Hello World\n\nThis is **bold** and this is *italic*.\n\n- Item 1\n- Item 2"
}
convert-html-to-markdown
Convert HTML to Markdown format.
Required fields:
action:"convert-html-to-markdown"html_text(string): HTML content to convert
Notes: Links are preserved. Line wrapping is disabled for clean output.
Example:
{
"action": "convert-html-to-markdown",
"html_text": "<h1>Title</h1><p>A paragraph with <a href=\"https://example.com\">a link</a>.</p>"
}
convert-yaml-to-json
Convert a YAML string to JSON.
Required fields:
action:"convert-yaml-to-json"yaml_text(string): Valid YAML string
Example:
{
"action": "convert-yaml-to-json",
"yaml_text": "name: Alice\nage: 30\nhobbies:\n - reading\n - hiking"
}
convert-json-to-yaml
Convert a JSON string to YAML format.
Required fields:
action:"convert-json-to-yaml"json_text(string): Valid JSON string
Example:
{
"action": "convert-json-to-yaml",
"json_text": "{\"name\":\"Alice\",\"age\":30,\"hobbies\":[\"reading\",\"hiking\"]}"
}
convert-query-string-to-json
Parse a URL query string into a JSON object.
Required fields:
action:"convert-query-string-to-json"query_string(string): URL query string (leading?is optional)
Notes: Parameters with a single value return a string. Parameters appearing multiple times return an array of values.
Example:
{
"action": "convert-query-string-to-json",
"query_string": "?name=Alice&city=NYC&tag=a&tag=b"
}
Common Workflows
- API response reformatting: Convert JSON API responses to CSV for spreadsheet import using
convert-json-to-csv. - Configuration migration: Convert YAML config files to JSON or vice versa using
convert-yaml-to-json/convert-json-to-yaml. - Content publishing: Convert Markdown drafts to HTML for web publishing using
convert-markdown-to-html. - Legacy system integration: Convert between XML and JSON when bridging old and new systems using
convert-xml-to-json/convert-json-to-xml. - URL parameter extraction: Parse query strings from URLs into structured JSON using
convert-query-string-to-json. - Timestamp handling: Convert between Unix timestamps and readable dates for logging or scheduling using
convert-unix-to-date/convert-date-to-unix.
Important Notes
- All input data is passed as strings in the respective text parameters (
json_text,csv_text,xml_text, etc.). - CSV input must include a header row for
convert-csv-to-json. - XML-to-JSON and JSON-to-XML conversions use
@attributesfor XML attributes and#textfor text content. - Timezone values must use IANA format (e.g.,
"America/Chicago", not"CST"). - JSON inputs must be valid JSON strings; malformed input returns an error.







