---
name: 402utils.com
description: 402utils.com provides a small set of data-conversion and utility endpoints accessible via x402 micropayments. It handles bidirectional JSON/CSV conversion, HTML-to-Markdown transformation, timezone-aware datetime conversion, and a request-echo endpoint for integration testing.
host: 402utils.com
---

# 402utils.com

402utils.com is a general-purpose utility host targeting agents and developers who need lightweight, stateless data transformation without standing up their own conversion infrastructure. It covers four practical conversion tasks (JSON↔CSV, HTML→Markdown, datetime timezone shifting) plus one diagnostic tool for verifying x402 payment plumbing. It does not offer storage, retrieval, or computation beyond these conversions.

## When to use this host

Use 402utils.com when an agent needs a quick, stateless conversion between JSON and CSV, HTML and Markdown, or between time zones, and does not want to maintain its own conversion service. Use echo-request-payload specifically to debug x402 payment integration — it is the only endpoint suited for that purpose. Do not use this host for: bulk or streaming conversions exceeding 5 MB or 100,000 rows; type-coerced CSV parsing (all CSV values return as strings); fetching URLs before HTML conversion (pair with a separate scraping host); recurring or bulk timezone lookups; or any computation, storage, or retrieval beyond the four conversion types offered. For XML, Parquet, or other non-CSV/JSON formats, a dedicated ETL or data-pipeline host is more appropriate.

## Capabilities

### Tabular Data Conversion

Converts between JSON arrays of objects and CSV text in both directions, supporting delimiter options, nested-field flattening, header handling, and parse-error recovery.

- **`convert-json-to-csv`** — Converts a JSON array of objects into RFC 4180 CSV with a header row, CRLF record separators, correct quoting, nested-object dot-notation flattening, and optional column selection and delimiter choice.
- **`convert-csv-to-json`** — Parses CSV text into structured JSON with headers, typed rows, row count, delimiter detection, and recoverable parse errors — all values remain strings.

### Document Format Conversion

Transforms raw HTML documents or fragments into clean GitHub-Flavored Markdown, optionally extracting the main article content via Readability.

- **`convert-html-to-markdown`** — Converts an HTML document or fragment to GitHub-Flavored Markdown, stripping scripts/styles and optionally isolating the main article via Mozilla Readability.

### Datetime Conversion

Converts a single datetime string between any two IANA time zones with correct DST handling and UTC offset resolution.

- **`convert-timezone-datetime`** — Converts a datetime string between any two IANA time zones, returning ISO-offset datetimes, UTC offsets, and DST status for both sides.

### Integration Testing

Echoes an arbitrary JSON payload back with a server timestamp, allowing agents to verify that x402 payment flow and HTTP plumbing are functioning correctly.

- **`echo-request-payload`** — Posts any JSON object to the server and receives it back unchanged alongside an ISO 8601 server timestamp, useful for verifying x402 client integration end to end.

## Workflows

### CSV Round-Trip Validation

*Use when an agent needs to verify that a CSV dataset survives a full parse-and-reserialize cycle without data loss or structural changes.*

1. **`convert-csv-to-json`** — Parse the original CSV into a structured JSON array of objects, capturing headers and any parse errors.
2. **`convert-json-to-csv`** — Re-serialize the JSON array back to CSV using the same delimiter, then compare output against the original to detect drift.

### Web Content Ingestion Pipeline

*Use when an agent needs to fetch HTML from an external source, convert it to Markdown for LLM consumption, and then store or transmit the result as structured tabular data.*

1. **`convert-html-to-markdown`** — Convert the retrieved HTML document into clean Markdown, optionally isolating the main article body.
2. **`convert-json-to-csv`** — If the downstream system requires tabular output, serialize extracted structured fields (e.g. title, excerpt, markdown body) as a CSV row.

## Skill reference

### `convert-json-to-csv`

**JSON to CSV Converter** — Converts a JSON array of objects into RFC 4180 CSV with a header row, CRLF record separators, correct quoting, nested-object dot-notation flattening, and optional column selection and delimiter choice.

*Use when:* Use when an agent needs to transform structured JSON records into a CSV file ready for Excel, Google Sheets, or a data pipeline, especially when column ordering, custom delimiters, or nested-field flattening is required.

*Not for:* Do not use for converting non-JSON formats (e.g. XML, Parquet) to CSV, or for streaming large datasets beyond 100,000 rows or 5 MB body size.

**Inputs:**

- `rows` (array, required) — 1–100,000 plain JSON objects, one per CSV record. Nested objects flatten to dot-notation column names; arrays are JSON-encoded into their cell; null becomes an empty cell.
- `delimiter` (string) — Field separator character. One of: comma (,), semicolon (;), tab (\t), or pipe (|). Defaults to comma.
- `columns` (array) — Optional list of flattened dot-notation column names controlling selection and order. Unknown names produce empty cells. Omit to use the union of all flattened row keys in first-seen order.

**Returns:** Returns a text/csv body with a header row and one CRLF-delimited record per input object, columns ordered as specified, nested fields flattened to dot-notation, and arrays JSON-encoded into their cells.

**Example:** `{"rows":[{"date":"2025-02-01","transactionId":"TX-4F2A19","product":"Widget A","region":"North","quantity":120,"revenue":24000,"cost":15600,"channel":"online","status":"paid"}],"delimiter":",","columns":["date","transactionId","product","region","quantity","revenue","cost","channel","status"]}`

---

### `convert-csv-to-json`

**CSV to JSON Converter** — Parses CSV text into structured JSON with headers, typed rows, row count, delimiter detection, and recoverable parse errors — all values remain strings.

*Use when:* Use when an agent needs to transform raw CSV data (comma, semicolon, tab, or pipe delimited) into a structured JSON array of objects or arrays, including handling of quoted fields, mixed line endings, BOM, and ragged rows.

*Not for:* Do not use for type-coerced output — all values are returned as strings. Not suitable for files larger than 5 MB or for non-CSV formats such as TSV with custom delimiters beyond comma, semicolon, tab, or pipe.

**Inputs:**

- `csv` (string, required) — Raw CSV text to parse. Can be sent as a plain string or inside a JSON body as the 'csv' key. Max 5 MB.
- `headers` (boolean) — When true (default), the first row is treated as column headers and rows are returned as objects keyed by header name. When false, rows are returned as arrays of raw string fields.
- `delimiter` (string) — Field delimiter character. If omitted, the parser auto-detects comma, semicolon, tab, or pipe.

**Returns:** Returns headers array, rows as an array of string-valued objects keyed by column name, rowCount integer, delimiter string, and an errors array (empty when parsing succeeds cleanly).

**Example:** `{"csv":"date,product,region,quantity,revenue,cost\n2025-01-15,Widget A,North,142,28400,18460\n2025-01-16,Widget B,South,89,13350,9345","headers":true,"delimiter":","}`

---

### `convert-html-to-markdown`

**HTML to Markdown Converter** — Converts an HTML document or fragment to GitHub-Flavored Markdown, stripping scripts/styles and optionally isolating the main article via Mozilla Readability.

*Use when:* Use when an agent needs to transform raw HTML into clean, readable Markdown — for example, before storing web content in a knowledge base, feeding it to an LLM, or rendering it in a Markdown-only interface.

*Not for:* Do not use to fetch and convert a URL — this endpoint only converts HTML provided inline in the request body; use a web-scraping or fetch API first to retrieve the HTML.

**Inputs:**

- `html` (string, required) — HTML document or fragment to convert. Max 5 MB. Nothing is fetched — provide the raw HTML inline.
- `mode` (string) — Conversion mode: 'full' converts the entire document; 'article' uses Mozilla Readability to isolate the main article, strip nav/footer boilerplate, and resolve relative links. Defaults to full.

**Returns:** Returns a markdown string with ATX headings, bold/italic emphasis, bullet lists, and pipe tables, plus a mode field echoing the requested conversion mode.

**Example:** `{"html":"<!doctype html><html lang=\"en\"><head><title>Q3 results</title></head><body><h1>Q3 results</h1><p>Revenue grew <strong>18%</strong> year-over-year.</p><ul><li>EMEA: +21%</li></ul><table><thead><tr><th>Region</th><th>Growth</th></tr></thead><tbody><tr><td>EMEA</td><td>+21%</td></tr></tbody></table></body></html>","mode":"full"}`

---

### `convert-timezone-datetime`

**Timezone Converter** — Converts a datetime string between any two IANA time zones, returning ISO-offset datetimes, UTC offsets, and DST status for both sides.

*Use when:* Use when an agent needs to convert a specific date and time from one IANA time zone to another, including correct DST handling, UTC offset resolution, and detection of ambiguous or skipped wall-clock times.

*Not for:* Do not use for streaming or recurring time zone lookups across many timestamps in bulk — this is a single-shot per-request conversion. Not suitable for looking up current local time without a known datetime input.

**Inputs:**

- `datetime` (string, required) — The datetime to convert. A datetime without a UTC offset is interpreted as wall time in the `from` zone. Ambiguous fall-back times resolve to the earlier instant; spring-forward gaps shift ahead and are flagged in `note`.
- `from` (string, required) — IANA time zone name of the source zone. Unknown zone returns 400 with a spelling suggestion.
- `to` (string, required) — IANA time zone name of the destination zone. Unknown zone returns 400 with a spelling suggestion.

**Returns:** Returns input and output ISO datetimes with offsets, UTC offsets for both zones, and a dstActive object indicating DST status on each side; an optional note field appears for ambiguous or skipped times.

**Example:** `GET https://402utils.com/v1/timezone-convert?datetime=2026-07-14T09:30:00&from=Europe/Paris&to=Asia/Ho_Chi_Minh`

---

### `echo-request-payload`

**Echo Utility API** — Posts any JSON object to the server and receives it back unchanged alongside an ISO 8601 server timestamp, useful for verifying x402 client integration end to end.

*Use when:* Use when an agent needs to verify that its x402 payment flow and HTTP request/response plumbing are working correctly by round-tripping an arbitrary JSON payload through a paid endpoint.

*Not for:* Do not use for production data processing or any meaningful computation; this endpoint exists solely for integration testing and payment flow verification.

**Inputs:**

- `body` (object, required) — Any valid JSON object; it is returned verbatim in the response under the 'echo' key. No specific fields are required.

**Returns:** Returns the submitted JSON object verbatim under 'echo' and the server processing time as an ISO 8601 string under 'ts'.

**Example:** `POST https://402utils.com/v1/echo
Content-Type: application/json

{"msg": "hello farm"}`

---
