Go to Sign up
Note: Your files never leave your device. We don't upload, transfer, or store your data.
|
|
|
|
|---|---|---|
|
|
|
A Ruby array is an ordered, integer-indexed collection of objects. Arrays are one of the most fundamental data structures in Ruby, used to store lists of values — numbers, strings, objects, or even other arrays. Ruby arrays are dynamic: they grow and shrink automatically, and they can hold mixed types in a single collection.
When you convert spreadsheet data to a Ruby array, you get a ready-to-paste code block you can drop into Rails seed files, test fixtures, configuration files, or any Ruby script that needs tabular data.
| Syntax | Example | Result |
|---|---|---|
[] literal | ["Alice", "Bob", "Carol"] | Array of 3 strings |
%w[] word list | %w[red green blue] | ["red", "green", "blue"] |
%i[] symbol list | %i[active pending closed] | [:active, :pending, :closed] |
| Nested array | [["Alice", 30], ["Bob", 25]] | Array of arrays (2D) |
Array.new | Array.new(3, 0) | [0, 0, 0] |
Rails seed data — Paste converted arrays directly into db/seeds.rb to populate your database with initial records.
Test fixtures — Generate Ruby arrays for Minitest or RSpec test setups without manual data entry.
Configuration files — Store lookup tables, permission lists, or enumeration values as Ruby constants.
Data migration — Move spreadsheet data into Ruby-based systems without intermediate CSV parsing.
Rapid prototyping — Convert product catalogs, pricing tiers, or geographic data into arrays you can iterate over immediately.
Drag-and-drop upload — Drop any .xlsx, .xls, or .xlsm file onto the upload zone.
Built-in table editor — Modify cell values, add or delete rows and columns, transpose, deduplicate, and apply case transformations before conversion.
Multi-sheet support — Switch between worksheets in multi-sheet workbooks via the sheet selector dropdown.
First Row as Header toggle — Control whether the first row is treated as column headers or regular data.
Find & Replace — Bulk-replace cell values with optional regex and case-sensitive matching.
Undo / Redo — Full edit history so you can revert mistakes.
Copy & Download — One-click copy of the generated Ruby array code, and you can also download the generated Ruby array code.
100% client-side — Your spreadsheet data never leaves your device. No files are uploaded to any server.
Upload your file — Drag an .xlsx, .xls, or .xlsm file onto the upload area, or click Click here to choose to browse.
Edit if needed — Use the built-in table editor to modify values, add or remove rows and columns, transpose, deduplicate, or apply case changes.
Set options — Toggle First Row as Header on or off depending on your data structure.
Click Convert — Press the Convert button in the Properties panel. The Ruby array output appears in the Output Data area.
Copy & Download the result — Click Copy to Clipboard and paste the Ruby code into your project, and you can also download the generated Ruby array code
Input spreadsheet (employees.xlsx):
| Name | Department | Salary |
|---|---|---|
| Alice | Engineering | 95000 |
| Bob | Marketing | 72000 |
| Carol | Engineering | 102000 |
Generated Ruby array output:
[
["Name", "Department", "Salary"],
["Alice", "Engineering", "95000"],
["Bob", "Marketing", "72000"],
["Carol", "Engineering", "102000"]
]
With First Row as Header enabled, the output becomes an array of hashes — ideal for Rails seed files:
[
{"Name"=>"Alice", "Department"=>"Engineering", "Salary"=>"95000"},
{"Name"=>"Bob", "Department"=>"Marketing", "Salary"=>"72000"},
{"Name"=>"Carol", "Department"=>"Engineering", "Salary"=>"102000"}
]
| Method | Description | Example |
|---|---|---|
.length | Returns the number of elements | [1,2,3].length # => 3 |
.push / << | Append an element | arr << "new" |
.map | Transform each element | [1,2,3].map { |n| n * 2 } |
.select | Filter elements by condition | arr.select { |r| r[1] == "Engineering" } |
.flatten | Collapse nested arrays | [[1,2],[3]].flatten # => [1,2,3] |
.each | Iterate over elements | data.each { |row| puts row[0] } |
| Aspect | Array of Arrays | Array of Hashes |
|---|---|---|
| Access pattern | Index-based: row[0] | Key-based: row["Name"] |
| Readability | Lower — must remember column order | Higher — self-documenting keys |
| Memory | Compact | Slightly larger (key storage) |
| Best for | Fixed-position data, matrices | Rails seeds, API responses, configs |
Use the First Row as Header toggle to switch between array-of-arrays and array-of-hashes output.
The tool accepts Microsoft Excel files in .xlsx, .xls, and .xlsm formats. LibreOffice and Google Sheets files exported as .xlsx also work.
No. All processing happens entirely in your browser using client-side JavaScript. Your file never leaves your device. There are no server uploads, transfers, or storage of any kind.
Yes. After uploading, a full table editor appears. You can modify individual cells, add or delete rows and columns, transpose the table, remove duplicates, apply case transformations (UPPERCASE, lowercase, Capitalize), and perform find-and-replace operations.
With First Row as Header disabled, each row becomes a nested array — accessed by index (row[0], row[1]). With it enabled, each row becomes a hash — accessed by column name (row["Name"]). Array-of-hashes is more readable and preferred for Rails seed data.
Yes. When your workbook contains multiple sheets, a dropdown selector appears in the editor header. Choose the sheet you want to convert.
The converter outputs all cell values as strings to preserve fidelity. In your Ruby code, you can convert types as needed: row["Salary"].to_i or row["Price"].to_f.
Since processing is entirely client-side, the limit depends on your browser's memory. Most modern browsers handle workbooks with tens of thousands of rows without issues.
Copy the output, paste it into db/seeds.rb, and iterate over it. Example:
employees = [
{"Name"=>"Alice", "Department"=>"Engineering", "Salary"=>"95000"},
{"Name"=>"Bob", "Department"=>"Marketing", "Salary"=>"72000"}
]
employees.each do |emp|
Employee.create!(
name: emp["Name"],
department: emp["Department"],
salary: emp["Salary"].to_i
)
end