Add Color to CSV
Add conditional color formatting to CSV files. Define rules to highlight cells by value, then export as a styled HTML table or colored spreadsheet.
About
Raw CSV data is structurally invisible. Without color, a file with 10,000 rows offers no visual hierarchy. Missed anomalies in financial reports, overlooked outliers in sensor logs, or silent duplicates in customer databases cause measurable damage. This tool applies conditional color formatting directly to CSV files using rule-based logic: if cell value in column C satisfies predicate P, apply background color H (as a hex triplet). Rules evaluate sequentially. Later rules override earlier ones on the same cell. The parser conforms to RFC 4180 for quoted fields and embedded delimiters.
Output is a fully styled HTML table you can open in any browser, print, or paste into documentation. The tool runs entirely in your browser. No data leaves your machine. Limitation: this tool does not produce .xlsx files with native Excel conditional formatting. It generates visual output only. For datasets exceeding 50,000 rows, expect rendering delays proportional to rule count.
Formulas
Each cell Ci,j is evaluated against all n rules in sequence. The final color applied is determined by the last matching rule:
Where Hk is the hex color of rule k, Pm is the predicate function of rule m, and colm is the target column index. For numeric operators, the cell value is parsed via parseFloat. If parsing yields NaN, the comparison returns FALSE. Regex predicates use the JavaScript RegExp constructor with no flags (case-sensitive). The "Contains" and "Equals" operators are case-insensitive by default, converting both operands to lowercase before comparison. The "Apply to All Columns" option sets colm = *, matching every column index.
Reference Data
| Operator | Description | Value Type | Example |
|---|---|---|---|
| Equals | Exact string match (case-insensitive) | Text / Number | status = active |
| Not Equals | Inverse of exact match | Text / Number | region ≠ US |
| Contains | Substring search (case-insensitive) | Text | email contains @gmail |
| Not Contains | Substring absence | Text | notes not contains error |
| Starts With | Prefix match | Text | id starts with PRD- |
| Ends With | Suffix match | Text | file ends with .csv |
| Greater Than | Numeric comparison > | Number | price > 100 |
| Less Than | Numeric comparison < | Number | qty < 5 |
| Greater or Equal | Numeric comparison ≥ | Number | score ≥ 90 |
| Less or Equal | Numeric comparison ≤ | Number | temp ≤ 0 |
| Is Empty | Cell is blank or whitespace-only | None | address is empty |
| Is Not Empty | Cell has content | None | phone is not empty |
| Regex | Regular expression test | Pattern | zip matches ^\d{5}$ |
| Between | Numeric range (inclusive) | Two Numbers | 10 ≤ age ≤ 65 |