Advertisement

XLSX to PHP array converter

Convert XLSX to PHP array free in your browser. Paste your XLSX on the left, press Convert, and copy clean PHP array on the right. No sign-up, no uploads.

Converter

Paste XLSX below, press Convert, and copy the PHP array output.

Picking a file reads its first sheet into the input box.

Advertisement

How the spreadsheet becomes PHP array

When you pick a file, the SheetJS library reads the first worksheet into a grid in memory, and the first row becomes the column headers for every row below it. That grid is exactly what you see staged in the input box as JSON, and pressing Convert reshapes it into PHP array with types preserved from the cells.

Tips for the PHP output

The snippet assigns $data, so rename the variable or wrap it in a return statement if you are building a config file. It is also a quick way to seed Laravel or WordPress fixtures: convert, paste into a seeder, and the nested array() syntax works on every supported PHP version.

XLSX to PHP array FAQs

Which part of my spreadsheet gets converted?
Upload any .xlsx or .xls file and the tool reads the first worksheet only, using its first row as the column headers. Blank rows are skipped. If your data lives on another sheet, move or copy it to the first sheet before uploading, or paste the cells as a JSON array of arrays.
Is the PHP output valid code I can run?
Yes. It prints a complete <?php snippet assigning $data with classic array() syntax, single-quoted strings with escaping, and null/true/false literals. Paste it straight into any PHP 5.4+ project. Nested values from XLSX fields are rendered as nested arrays.
Do cell types survive the conversion?
Numbers, booleans and text come through with their types, and empty cells become empty strings. Dates arrive as Excel serial values, so format date columns as text in Excel first if you need readable dates in the PHP array output.
Is there a size limit for XLSX input?
No hard limit, but everything runs in your browser tab, so tens of thousands of rows convert in seconds while millions of rows may slow the page. For very large XLSX files, split them into smaller chunks and convert each separately.
Is my XLSX data private, and who uses this?
Yes. The conversion runs 100% in your browser with the SheetJS library loaded from CDN; nothing is uploaded to any server. Developers, analysts and DBAs use it to move XLSX data into PHP array for migrations, reports and config work without installing anything.
Advertisement