ForHosting KIT · Data & Files

Validate CSV against a column schema

A CSV file can look orderly while still containing values that break an import, report, or data pipeline.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Runs in your browser. Free, unlimited — your data never leaves this page.

This validator checks the header against the exact columns you expect, then examines every data row using explicit string, number, integer, boolean, or ISO date rules. Instead of stopping at the first bad cell, it returns a complete list of violations with CSV row numbers and column names. Run it free in the browser or use the API for $0.002 per request when validation belongs in an automated workflow.

Define the contract before checking the file

Start by describing each expected column with three properties: its exact name, its type, and whether it is required. Column order matters because CSV is positional data; a file headed name,id is not safely interchangeable with one headed id,name, even when both names appear. The validator therefore compares the complete header with the schema before inspecting data rows. A missing, extra, renamed, duplicated, or reordered header produces an input error rather than a misleading validation report. Supported cell types are string, number, integer, boolean, and date. Numbers accept ordinary decimal and scientific notation, integers must be safe whole numbers, booleans accept true or false without regard to case, and dates use the unambiguous YYYY-MM-DD form with real calendar-day checking. A string accepts any non-empty textual value, while the required flag independently decides whether an empty cell is allowed. Keeping presence and type separate makes schemas precise: an optional integer may be blank, but whenever it is present it still must be an integer.

Read row and column violations accurately

The result begins with a valid flag and summary counts for checked rows, checked columns, and total violations. When valid is false, the violations array identifies each problem with a row number, a column name, a stable code, and a readable message. Row numbers follow the CSV itself, so row 1 is the header and the first record is row 2. That convention lets someone open the original file and jump directly to the reported location without subtracting offsets. A required violation means the cell is empty even though the schema marks it mandatory. A type violation means a non-empty value does not satisfy the declared type. Rows with too few or too many fields receive a column_count violation under the special _row column because the structural problem cannot reliably be assigned to one named cell. Quoted commas, escaped quotes, embedded line breaks, and CRLF files are parsed as CSV syntax, so legitimate punctuation inside a quoted value does not shift later columns or create a false report.

Place validation at the boundary of a workflow

Validate as close as possible to the point where a file enters your system. A partner upload can be rejected before it reaches a database, a scheduled export can be checked before downstream calculations run, and a user-facing importer can present all correctable cells in one response. Because the algorithm is deterministic and makes no network calls, the same CSV and schema always produce the same report. That makes the output suitable for automated gates as well as interactive cleanup. Treat a header mismatch differently from row violations: the former means the file is not the dataset your workflow expects, while the latter means the dataset has recognizable records that need correction. The validator reports problems but never edits, coerces, trims, or replaces source values. This avoids silently changing identifiers, leading zeros, or human-entered text. If your pipeline needs normalization, perform it as a separate deliberate step, then validate again against the contract that the destination actually requires. That separation keeps failures explainable and preserves the original evidence for review.

Import quality gate

Reject customer or partner CSV uploads with exact row and column feedback before they reach a database import.

Scheduled export monitoring

Check recurring exports for header drift, missing required cells, and values that no longer satisfy their declared types.

Bulk correction workflow

Return every detectable cell violation at once so an operator can repair a file in one review cycle.

Must the CSV header use the same order as the schema?

Yes. Names and order must match exactly; otherwise the request fails with an invalid-input header error.

Which column types are supported?

The schema supports string, number, integer, boolean, and date. Dates must use valid YYYY-MM-DD calendar dates.

Does the validator stop after the first bad row?

No. After the header passes, every data row is checked and all detected violations are returned together.

How are quoted commas and line breaks handled?

Standard quoted fields may contain commas, escaped double quotes, and line breaks without being split into extra columns.

Does this tool modify or coerce CSV values?

No. It only reports violations. It never trims, converts, fills, or rewrites the submitted CSV.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/data/csv-validate-schema

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/data/csv-validate-schema \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"csv":"id,email,active\n1,ada@example.com,true\n2,grace@example.com,false","schema":[{"name":"id","type":"integer","required":true},{"name":"email","type":"string","required":true},{"name":"active","type":"boolean","required":true}]}'
{
  "csv": "id,email,active\n1,ada@example.com,true\n2,grace@example.com,false",
  "schema": [
    {
      "name": "id",
      "type": "integer",
      "required": true
    },
    {
      "name": "email",
      "type": "string",
      "required": true
    },
    {
      "name": "active",
      "type": "boolean",
      "required": true
    }
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "data.csv_validate_schema",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →