SmartQueryTools

Pad Column in CSV Files Online

Left-pad or right-pad a column in CSV files to a fixed width directly in your browser. Zero-pad numeric codes, pad product IDs to a fixed length, or right-pad text fields — no upload required.

Drop your .csv file here

or click to browse — max 50 MB

About this tool

Pad any column in a CSV file to a fixed total width using lpad (left-pad) or rpad (right-pad). Left-padding is the standard way to zero-pad numeric codes like order numbers, postal codes, or product IDs so they sort and display consistently. Right-padding is used for fixed-width text exports where columns must occupy a specific number of characters. Values already at or longer than the target width are returned unchanged — no truncation. The pad character can be any single character. Runs entirely in your browser.

Frequently Asked Questions

What does left-padding a column in a CSV file do?

lpad extends values shorter than the target width by adding the pad character on the left. For example, lpad("42", 6, "0") gives "000042". Values that are already at or longer than the width are returned unchanged.

Can I pad a numeric column in a CSV file?

Yes. All values are first cast to VARCHAR before padding. This means numbers, dates, and any other type can be padded. The result is always a text column, so if you need the padded value to remain numeric, cast it back using the Cast Columns tool.

What happens to values longer than the target width when padding a CSV file?

lpad and rpad do not truncate — values longer than the specified width are returned as-is. If you need to enforce a strict fixed width that also truncates long values, use the Calculate Column tool with a substring expression.

Is my data private?

Yes — completely. Your file is never uploaded to any server. Everything runs locally in your browser using WebAssembly — processing happens entirely inside your tab. Once you close the tab, nothing is retained.

What is the maximum file size?

The free limit is 50 MB. For larger files, performance depends on your device's available memory — most modern machines handle 500 MB to 1 GB comfortably.

Related Tools