How to convert CSV to Excel and preserve leading zeros

Create an XLSX workbook from comma-separated text in TinyToolbox, verify the imported cells, and choose which columns to convert to numbers or dates.

Open the tool

A CSV file can contain a perfectly good identifier such as 0017. Open that file directly in a spreadsheet and the program may interpret the field as a number, displaying 17 instead. The same thing can happen to date-like codes and other values whose exact spelling matters. Storing the CSV fields as text in a workbook gives you a chance to decide which columns should eventually use spreadsheet types.

TinyToolbox CSV to Excel converts pasted comma-separated values into an XLSX workbook with one worksheet named Data. It writes the cells as text. This is a useful starting point for reviewing an export, preserving identifiers, or passing a workbook to a colleague who expects XLSX. Plan a separate typing step if the workbook needs to calculate with quantities, amounts, or dates.

Prepare the CSV as plain text

Open the exported CSV in a text editor. This shows the actual field values before a spreadsheet application interprets them. If the source already lost the leading zeros before it was saved, the workbook converter cannot restore them from the file. Go back to a trusted export or the originating system when the missing part of an identifier matters.

Check that the first record names every column and that each name is unique. If the export begins with a report title and some blank lines, remove those from your working text before conversion. A blank header, duplicate header, or row of a different width will cause an error. If you need to inspect these issues first, paste the source into CSV Validator and note the record or header it reports.

The converter expects commas. A spreadsheet can make a grid from text separated by tabs or semicolons, but this form expects comma-separated data. If your export uses another delimiter, regenerate it with commas using a CSV writer. A search-and-replace across the whole file can change punctuation within descriptions or comments. Keep the original export for comparison.

Convert the CSV in TinyToolbox

  1. Open CSV to Excel Converter.
  2. Paste the text into CSV with a header row.
  3. Confirm that at least one complete data record follows the header.
  4. Select Run tool.
  5. Select Download result to save converted.xlsx.
  6. Open the downloaded workbook and inspect the Data worksheet.

The conversion runs in your browser. The text limit is one million characters. The workbook can contain up to 250,000 cells, including the header row, and up to 16,384 columns. For example, 20,000 data rows indexed by 12 columns would require 240,012 cells including the header. Such a file can still exceed the text limit if its cells contain long descriptions. Both limits apply.

If the source is too large, choose a representative part for a trial or split it into several complete CSV inputs. Put a copy of the header at the beginning of each part and split only at record boundaries. A quoted field can span several physical lines, so cutting at a convenient line number can separate part of a note from the record it belongs to. Verify each resulting workbook, and combine them in your spreadsheet application if the final handoff calls for one workbook.

Try an export with codes, counts, and notes

Suppose you have a small workshop roster with four columns:

code,session,seats,note
0017,Welcome,12,"Main hall, north entrance"
0042,Seed starting,8,
0050,Questions,10,"Bring a notebook"

Paste the whole block, including the header, and convert it. In the workbook, the first data row should show 0017 exactly as written. The first note should stay in one cell even though it contains a comma. The blank note in the second row should occupy its own empty cell rather than taking a value from a neighboring row. Check the last row to confirm that the export did not end early.

The header uses ordinary words. If your CSV instead uses column labels that look like whole-number indexes, check their position in the output. The converter derives the workbook headings from JavaScript object keys, which can reorder integer-like names. Match the cells to their heading rather than assuming every source position was preserved for that kind of header. Distinct descriptive header names are easier to review.

After verifying the sample, compare a few rows in a real export. Include a code with leading zeros, a note with punctuation, and a row with an empty final cell. A converted workbook that looks right on only the simplest row can still hide a problem elsewhere in the source.

Check why counts and dates remain text

Every written cell is an inline string. A seat count that appears as 12 has the visual spelling of a number, but the workbook contains text there. A date such as 03/04/2026 also stays text. This is why a code retains its leading zeros, and why a date-like product identifier avoids an automatic date conversion on export.

If the receiver needs to calculate totals, convert only the columns that represent quantities or amounts in the destination spreadsheet. Test that a sum actually includes the values after conversion. Changing a cell’s appearance to a numeric format may not convert text into a number by itself. Use the spreadsheet’s text-to-number workflow and check a few values before applying it to every row.

For date columns, settle how the source represents the day and month. 03/04/2026 can mean different dates depending on locale. Preserve the original text until you know the intended convention, then convert the date column using that convention. Do not apply a whole-sheet conversion when neighboring columns contain codes. The workbook can legitimately have a numeric seats column, a date column, and text identifiers.

Values beginning with characters like an equals sign are written as text in this XLSX workbook. That is useful when the value itself is supposed to be visible. If you later paste values into an application that interprets them differently or export again to CSV, check how that application imports them. The type choice in this workbook does not establish what another import will do.

Resolve common CSV errors before retrying

If the converter reports that a record has too many columns, look for an unquoted comma in a description. Put that field in double quotes so the comma stays part of the text. To include a literal double quote inside a quoted cell, double it. An embedded line break also belongs inside the quotes for its field.

If a row is short, confirm that any missing final value still has a separator before it. In the workshop example, the row ending with 8, includes the empty note field. Without the last comma it would have only three fields. When the error reports a record number, remember that record 1 is the header and a multiline field can make records span more than one line.

If the workbook shows only one column, check the raw export for another delimiter. A consistent semicolon-delimited source can look like one field per row to a comma-based parser. The conversion can complete even though the workbook does not represent the grid you intended. Re-export using commas, rerun the tool, and check the resulting column count against the source specification.

If you need JSON for a different handoff, CSV to JSON converts the same kind of CSV records into named objects. For a later conversion from an existing workbook, Excel to CSV reads a selected worksheet. A CSV contains text records and cannot carry the workbook’s formatting or multiple worksheets with it. Check which worksheet and representation the recipient expects.

Verify the workbook before distributing it

Open the file you plan to share and confirm that it is an XLSX workbook with the expected sheet and records. Review the heading order, then check the first and last data rows. Test any cell that contains an embedded comma, a quoted note, leading zeros, or a value that resembles a date. If you converted some columns after download, confirm that identifiers remain intact and the spreadsheet now calculates with the columns you intended to type.

Give the reviewed workbook a descriptive name, especially if your downloads folder contains more than one file named converted.xlsx. Keep the CSV as a reference. If a later revision changes the header or adds a new kind of value, check a fresh workbook against the source before replacing the earlier one. A successful export is most useful when the workbook preserves the information you need and its types fit the next task.

Check an export with a multiline field and a blank value

Suppose you are transferring a small booking list. Each row contains a booking code, a seat count, and a note. The first note contains a comma, the second note spans two written lines, and the third is empty. Prepare a test export like this before converting the full list.

Booking,Seats,Note
0007,2,"Window, if available"
0018,3,"Arrives at 9
Call on arrival"
0042,1,

Paste the complete block into CSV to Excel. The line break after “Arrives at 9” stays inside the quoted note for booking 0018. It does not introduce another booking. Open the resulting workbook and verify that it contains three data rows below the header. If the spreadsheet shows only the first part of that note, check whether its row height is concealing the second line. Open the cell or enable wrapping in the spreadsheet to inspect its full value.

The final comma on the row for 0042 represents an empty third field. If you delete that comma, the row provides only two fields even though the header names three. Keep the empty field when it is part of the source schema. After conversion, check that the empty note stays associated with the correct booking and that the two preceding fields retain their values.

Before using the workbook for a seat count, convert only the Seats cells to numeric values in your spreadsheet. The sum should then be six. Check that Booking still shows 0007, 0018, and 0042. Converting the booking codes to numbers would remove the zeros that identify them in the source system. Label the converted worksheet or keep a separate sheet for calculations when you also need an untouched representation of the export.

If the long export fails at a particular record, isolate that record and the header in a working copy. When the field spans lines, include its opening and closing quotes and all intervening text. You can test the small copy in CSV Validator and compare the field count with the full export. Once you fix the source, rerun the conversion and verify the total number of records as well as the first and last identifiers. Checking the endpoints helps catch a truncated paste even when the remaining workbook opens normally.

Confirm the recipient selected the intended workbook columns

If the workbook will feed another import, exchange a small sample first. Use one row with a text identifier, another with a blank field, and a third with a quantity that should become numeric only if the destination asks for it. After opening the XLSX, check the header names and order before inspecting the values. A recipient mapping a column by position can interpret a reordered sheet differently even when each cell is correct.

Ask the recipient to compare the imported sample with the source text. Confirm that the identifier still has its leading zeros and that the blank field is accepted under their rules. If they need numbers for calculations, agree which column to convert and how to handle the blanks. Keep that instruction with the workbook so the same preparation can be repeated for the next export.