# CSV column calculator

- Human page: https://happytails.ai/en/data-tools/csv-column-calculator/
- Markdown: https://happytails.ai/en/data-tools/csv-column-calculator.md
- Structured JSON: https://happytails.ai/agents/en/data-tools/csv-column-calculator/index.json
- Visibility: public

## Tool capabilities

| Property | Value |
| --- | --- |
| Tool ID | `csv-column-calculator` |
| Category | data-tools |
| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |
| Browser execution | Use the visible action or interactive controls. |
| Browser processing | Browser; see tool notes for network behavior. |
| HTTP API | Not callable through HTTP. |
| Browser-agent interface | run_current_tool |

### Implementation notes

Create new columns from your existing data. Calculations use exact arithmetic and round only the final value; errors are listed by record. Your original columns stay intact. Processed on your device. CSV downloads protect spreadsheet formula prefixes by default, which changes affected cells.

### Inputs and settings

Text input: Source CSV.

Example or placeholder shown in the interface (not a validated fixture):

```text
CSV with a unique header
```

Use exact source headers in the expressions. Original cells and leading zeros remain strings. Up to 1,000,000 characters. Review the settings before running.

| Setting | Meaning | Control type | Default | Constraints |
| --- | --- | --- | --- | --- |
| `delimiter` | Input CSV separator | select | "," | Allowed: ,, ;, 	 |
| `expressions` | Derived column expressions | textarea | "name,expression\ntotal,quantity * unit_price" |  |
| `decimalPlaces` | Maximum output decimal places | select | "12" | Allowed: 2, 6, 12, 16 |
| `exportMode` | Spreadsheet formula handling | select | "Protect formulas" | Allowed: Protect formulas, Preserve original cells |

### Browser-agent workflow

1. Open the human page in a browser that supports WebMCP.
2. Discover the interface exposed by that page; use its actual schema.
3. Select files on the page first when the tool requires files.
4. Call `run_current_tool` with valid input and settings.
5. Inspect the returned result or error and the displayed output. Retrieve files from the displayed download links.

Calls do not automatically copy or download results. Browser permissions still apply. Interface availability alone is not proof of successful execution.

### Planning specification

At most 20 expressions of 1,000 characters, 200 syntax nodes and 32 nested groups or signs each; 500,000 total row-node evaluations and 10,000 errors. Input decimals permit 100 significant digits and 30 fractional places; exact reduced numerators and denominators permit 256 digits. Output permits 100 significant digits. Up to 1,000,000 input characters, 10,000 records, 100 columns including additions and 100,000 cells. CSV output is capped at 4,000,000 characters.

This describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.

### Complete machine-readable capability record

```json
{
  "id": "csv-column-calculator",
  "category": "data-tools",
  "built": true,
  "requirements": "At most 20 expressions of 1,000 characters, 200 syntax nodes and 32 nested groups or signs each; 500,000 total row-node evaluations and 10,000 errors. Input decimals permit 100 significant digits and 30 fractional places; exact reduced numerators and denominators permit 256 digits. Output permits 100 significant digits. Up to 1,000,000 input characters, 10,000 records, 100 columns including additions and 100,000 cells. CSV output is capped at 4,000,000 characters.",
  "implementation": {
    "fields": [
      {
        "key": "delimiter",
        "label": "Input CSV separator",
        "value": ",",
        "type": "select",
        "values": [
          ",",
          ";",
          "\t"
        ]
      },
      {
        "key": "expressions",
        "label": "Derived column expressions",
        "value": "name,expression\ntotal,quantity * unit_price",
        "type": "textarea",
        "help": "CSV with headers name,expression. Up to 20 distinct new columns. Use + - * /, parentheses, decimals and exact column names. Use [unit price] for spaces, and ]] inside brackets for a literal ]. No functions, strings or references to other derived columns."
      },
      {
        "key": "decimalPlaces",
        "label": "Maximum output decimal places",
        "value": "12",
        "type": "select",
        "values": [
          "2",
          "6",
          "12",
          "16"
        ]
      },
      {
        "key": "exportMode",
        "label": "Spreadsheet formula handling",
        "value": "Protect formulas",
        "type": "select",
        "values": [
          "Protect formulas",
          "Preserve original cells"
        ]
      }
    ],
    "registrationFamily": "csv-preparation",
    "presentation": "metrics",
    "note": "Create new columns from your existing data. Calculations use exact arithmetic and round only the final value; errors are listed by record. Your original columns stay intact. Processed on your device. CSV downloads protect spreadsheet formula prefixes by default, which changes affected cells.",
    "experience": {
      "automatic": false,
      "single": false,
      "inputMaxLength": 1000000,
      "inputMode": "text",
      "label": "Source CSV",
      "placeholder": "CSV with a unique header",
      "help": "Use exact source headers in the expressions. Original cells and leading zeros remain strings. Up to 1,000,000 characters. Review the settings before running.",
      "action": null
    },
    "mode": "explicit",
    "interactive": false
  },
  "execution": "Browser interface",
  "api": null,
  "browser_agent": {
    "supported": true,
    "name": "run_current_tool",
    "discovery": "WebMCP on the human page in a supporting browser",
    "verification": "See audit/API-AUDIT.md; availability is not verification"
  }
}
```

## Page guide

Calculate new CSV columns from existing values, then review results and errors before downloading.

### How to use CSV column calculator

1. Paste CSV with a unique header and unchanged source values.
2. Add a name,expression CSV of distinct derived columns and choose output decimal precision.
3. Review derived values and the located errors CSV, then download the complete CSV and JSON report.

How can we improve this tool?

Report a problem or share an idea.

Please leave out private information. Your message and the tool name go to our team via PostHog.

## Useful next steps

- [CSV anonymizer](https://happytails.ai/en/data-tools/csv-anonymizer/) ([Markdown](https://happytails.ai/en/data-tools/csv-anonymizer.md))

- [CSV encoding repair](https://happytails.ai/en/data-tools/csv-encoding-repair/) ([Markdown](https://happytails.ai/en/data-tools/csv-encoding-repair.md))

## Exact calculations with explicit rounding

Use decimals, exact source column names, + - \* / and parentheses. Bracket headers containing spaces, for example \[unit price\]. Exact rational intermediates round only when each final result is written, using nearest with ties to even. Choose 2, 6, 12 or 16 decimal places. Trailing fractional zeros are omitted.

### Visible errors without code execution

Expressions cannot run JavaScript, call functions, access properties or reference other derived columns. Invalid expressions, missing columns, nonnumeric cells, division by zero and arithmetic bounds leave affected derived cells empty and appear by one-based source record in the errors CSV.

### Local processing and exact strings

Processing runs on your device. CSV downloads quote every cell and protect spreadsheet formula prefixes by default, which changes affected strings. Preserve original cells is for trusted machine processing. Import identifiers as text in spreadsheet applications to preserve leading zeros.
