Trim CSV cell values to a maximum character length
Trim CSV cell values to a specified maximum character length with optional ellipsis.
🛡️ Your rows never leave your browser.
Why Onfyt: Truncates at character boundaries, not byte boundaries—prevents truncating mid-character for UTF-8 strings with accented or CJK characters.
Interactive Sample Data
| id | name | description |
|---|---|---|
| 1 | Solar Panel 250W | High-efficiency monocrystalline solar panel with 25-year performance warranty and IP68 waterproof rating suitable for residential and commercial installations in equatorial climates. |
| 2 | Inverter | Short |
How this tool works
Database import failures commonly occur because a text column in the source CSV exceeds the target column's VARCHAR length constraint (VARCHAR(255) or VARCHAR(500)). Truncating text to the maximum allowed length before import prevents row-level insert failures.
DataFix truncates at character boundaries (not byte boundaries), which matters for multi-byte UTF-8 characters like accented letters and emoji. The optional ellipsis ('...') is appended within the length budget (e.g., truncating to 255 with ellipsis gives 252 characters + '...').
Enforcing character length constraints prevents string-truncation errors when exporting text into databases with rigid VARCHAR length limits, adding optional ellipsis indicators while preserving word boundaries.
When truncating strings to satisfy rigid database schema limits, cleanly handling multi-byte UTF-8 character boundaries and international accents prevents corrupted terminal characters (mojibake). Our truncator safely truncates by Unicode code points rather than raw byte offsets. Safe boundary truncation checks prevent trailing orphaned punctuation marks or broken escape characters, leaving clean, grammatically coherent text previews ready for catalog display.
Constraining string lengths prevents database insertion failures when loading long customer notes into fixed-width VARCHAR columns. Optional word boundary preservation avoids awkward half-word truncations in customer-facing interfaces. Reversible truncation configurations allow exporting both the truncated summary column and the original unabridged text in parallel reference fields. Smart boundary detectors ensure that trailing periods or commas are cleaned up neatly when shortening descriptive phrases.
Things that usually go wrong
- Truncating at a character count may cut in the middle of a multibyte character (emoji, CJK) — the tool truncates at code-point boundaries, not bytes.
- Truncating at word count does not ensure a character limit.
Edge cases we tested
🧪 Multi-byte UTF-8 characters (é, ñ, 中) near truncation boundary
Truncated at character boundary, not mid-codepoint byte sequence.
🧪 Value exactly at the limit
No truncation applied; ellipsis not added.
Frequently Asked Questions
Can I truncate to a fixed width for a display column?
Yes — set the character limit and enable 'add ellipsis' for a clean display-ready truncation.
Does this modify the original column or add a new one?
By default a new column is added. Toggle 'Replace original' to overwrite.
Related tools
Clean
Split Full Name into First and Last
Separate full name columns into dedicated first_name and last_name columns in CSV and Excel spreadsheets.
Open Tool →
Clean
Combine First and Last Name
Merge separate first and last name columns into a single clean full_name column, trimming extra spaces.
Open Tool →
Clean
Remove Duplicate Rows
Eliminate duplicate rows across your entire dataset or based on specific unique key columns.
Open Tool →