---
title: "Test the Same Data Across JSON, XML and CSV | Mochavi Payloads"
description: "Compare JSON, XML, CSV, YAML and binary decoders against equivalent records instead of unrelated sample files."
canonical: "https://payloads.mochavi.com/guides/same-test-data-json-xml-csv"
markdown_mirror: "https://payloads.mochavi.com/guides/same-test-data-json-xml-csv.md"
language: "en"
generated_from: "Payloads source content"
---

> Canonical HTML: [https://payloads.mochavi.com/guides/same-test-data-json-xml-csv](https://payloads.mochavi.com/guides/same-test-data-json-xml-csv)
>
> This machine-readable Markdown page mirrors the canonical Payloads documentation.

# Test the Same Data Across JSON, XML and CSV

Use one canonical users, projects and tasks dataset across formats to test conversions and parser consistency.

## Short answer

Payloads generates JSON, XML, CSV, YAML, NDJSON, MessagePack, CBOR, text and HTML from one canonical dataset. The representation changes, while IDs, strings, nulls, booleans, numbers and relationships remain comparable.

## Use equivalent collection URLs

Start with the users collection and change only the extension. This makes discrepancies easier to attribute to serialization or decoding rather than to different sample content.

**Equivalent collection fixtures**

```text
https://payloads.mochavi.com/v1/users.json
https://payloads.mochavi.com/v1/users.xml
https://payloads.mochavi.com/v1/users.csv
https://payloads.mochavi.com/v1/users.yaml
https://payloads.mochavi.com/v1/users.msgpack
https://payloads.mochavi.com/v1/users.cbor
```

## Compare meaning, not punctuation

JSON objects, XML elements and CSV rows do not have identical syntax or type systems. Normalize each decoded result into your application's domain shape before comparing it.

CSV is necessarily flatter than the object formats. XML carries explicit type information in the Payloads representation, while JSON, MessagePack and CBOR preserve native scalar values directly.

- Compare IDs and relationships after decoding.
- Define how an empty field differs from null in your importer.
- Normalize timestamps before comparing values.
- Keep Unicode and escaped markup in the test set.

## A useful cross-format test matrix

| Concern | Fixtures to compare | What it catches |
| --- | --- | --- |
| Text escaping | JSON, XML, CSV | Quotes, markup characters and delimiters |
| Scalar types | JSON, XML, YAML, CBOR | Boolean, number and null coercion |
| Line processing | CSV, NDJSON, text | Record boundaries and newline handling |
| Binary decoding | MessagePack, CBOR | Buffer handling and decoder configuration |

## Validate against the canonical schema

The JSON Schema describes the canonical users, projects and tasks model. It is a useful reference for expected fields and relationships even when the wire format is not JSON.

- [Open the JSON format guide](https://payloads.mochavi.com/formats/json)
- [Open the XML format guide](https://payloads.mochavi.com/formats/xml)
- [Open the CSV format guide](https://payloads.mochavi.com/formats/csv)
- [Open the dataset schema](https://payloads.mochavi.com/v1/schemas/dataset.schema.json)
