Conversion is a data-model problem

Formats that look similar do not preserve the same information. JSON has objects, arrays, numbers, strings, booleans, and null. CSV has rows and fields but no universal types. YAML can express comments, anchors, tags, and presentation details. Markdown describes prose structure; HTML describes a document tree. Base64 is an encoding, not encryption. URL encoding applies differently to path, query, and fragment components.

Syntactically valid output can still be corrupted.

The safe question is what meaning exists in the source that the target cannot represent.

Use a five-step preflight

1Identify source

Do not rely on auto-detection when punctuation overlaps.

2Define consumer

An API, spreadsheet, website, and human export need different output.

3Predict loss

Types, comments, formulas, ordering, and encoding may not survive.

4Convert sample

Include edge cases before processing the full dataset.

5Parse and compare

Validate with the system that will consume the result.

JSON: strict structure and real types

JSON requires double-quoted keys and strings, does not allow comments or trailing commas, and cannot represent NaN or Infinity. Common failure points include large integers rounded by consumers, dates reduced to strings, duplicate keys overwritten, and unescaped control characters. After formatting or conversion, parse the output again rather than checking appearance.

CSV: context hidden inside a simple file

CSV failure cases
ValueFailureSafe handling
Comma in textExtra columnQuote the field
Quote in textPremature closeDouble the quote
Leading zeroIdentifier becomes a numberImport as text
Long integerPrecision lossKeep as text
Formula-like prefixSpreadsheet executionSanitize untrusted exports

Real systems also use tabs, semicolons, different encodings, and application-specific import rules. Parse genuine CSV instead of splitting on commas.

JSON and YAML are not perfectly reversible

JSON-to-YAML is usually straightforward. YAML-to-JSON may discard comments, anchors, aliases, explicit tags, and scalar style. Quote identifiers, version numbers, dates, and ambiguous values when their string identity matters. Test with the actual parser used by the destination.

Markdown and HTML conversions are lossy

Arbitrary HTML can contain layout, forms, scripts, attributes, embedded media, and custom components that Markdown cannot express. HTML-to-Markdown should preserve semantic content, not the full page. Markdown-to-HTML is more predictable within the renderer’s supported syntax. Sanitize generated HTML before publishing untrusted input.

Base64 encodes bytes; it does not protect them

Base64 makes binary data representable as text and increases size. Anyone can decode it. Text must be converted to bytes—usually UTF-8—and decoded with the same character encoding.

Base64 is not a security boundary.

Do not use it to hide secrets, credentials, personal information, or executable content.

URL encoding is component-specific

Encoding a complete URL as though it were a query value can corrupt separators. Encode values before inserting them into query parameters, avoid double encoding, use a standards-aware URL parser, and never assume decoded user input is safe HTML or a safe redirect.

Use Jivaro’s converter

  1. Open Text & Data Format Converter.
  2. Select source and target explicitly when detection is ambiguous.
  3. Paste a representative sample.
  4. Choose JSON pretty/minify, JSON↔YAML, Markdown↔HTML, HTML→text/BBCode, CSV→JSON, URL encode/decode, or Base64 encode/decode.
  5. Inspect errors and preview.
  6. Validate in the destination parser.
  7. Compare key counts, row counts, types, and edge values.

Verification checklist

SyntaxCan the target parse it?

Use a real parser or importer.

ShapeDid structure survive?

Compare keys, rows, and nesting.

TypesDid strings remain strings?

Check IDs, dates, booleans, nulls, and large numbers.

EncodingAre characters intact?

Test names, symbols, and line endings.

SecurityCan output execute?

Sanitize HTML and spreadsheet-bound data.

Round tripDoes meaning return?

Convert back when the formats permit it.

Round-trip examples reveal hidden loss

Convert a YAML configuration to JSON and back: comments and anchors may disappear even when values return. Convert CSV to JSON and back: column order, quoted empty strings, and numeric-looking identifiers may change. Convert Markdown to HTML and back: raw attributes, custom blocks, and exact whitespace may be lost. These are not converter defects when the target format has no equivalent representation.

Create a small “golden” sample containing empty values, Unicode, delimiters, long integers, nested data, and leading zeros. Store the expected parsed result and use it whenever the workflow or converter changes.

Security checks for generated output

Structured text can become executable when imported. HTML can run active content, spreadsheet cells can trigger formulas, URLs can redirect users, and decoded Base64 can contain files or scripts. Treat conversion as representation change—not validation or sanitization. Apply the destination’s security controls after conversion and before publication or execution.

Frequently asked questions

Is YAML always compatible with JSON?

JSON is aligned with YAML 1.2, but comments, anchors, tags, scalar styles, and parser behavior can make conversion lossy.

Why did CSV lose leading zeros?

The importer likely interpreted identifiers as numbers. Import that column as text or use a typed format.

Does Base64 encrypt data?

No. It only changes the representation of bytes.

How do I verify a conversion?

Parse it in the destination system, compare structure and types, test Unicode and edge values, and round-trip when possible.

Related Jivaro apps

Writing & textText & Data Format Converter

Format and convert JSON, YAML, XML, CSV, TSV, NDJSON, Markdown, HTML, BBCode, URLs, Base64, and plain text directly in your browser.

Open app

Sources and references