Go to Sign up
Note: Your files never leave your device. We don't upload, transfer, or store your data.
|
|
|
|
|---|---|---|
|
|
|
The Markdown To Ruby Array Converter on A.Tools transforms Markdown pipe-delimited tables into Ruby array literals — valid Ruby code you can paste directly into scripts, Rails seed files, or test fixtures. All processing runs in your browser. No data leaves your device.
Developers write Markdown tables in documentation and README files. Ruby applications need data as arrays and hashes. This tool converts between the two without manual typing.
Click Enter Data to paste a Markdown table into the input area, or click Choose File to drag and drop a .md file. Press Sample to load example data.
Once parsed, an interactive spreadsheet appears. Use the toolbar to:
Add or delete rows and columns
Transpose the table (swap rows and columns)
Remove duplicate rows
Delete empty rows and columns
Change text case (UPPERCASE, lowercase, Capitalize)
Find and replace values — supports case-sensitive search and regex
Toggle First Row as Header to define column names
Right-click any cell for context-menu operations.
Click Convert to generate the Ruby array output. Use Copy to Clipboard or Download File to save.
Two input modes: Paste Markdown directly or upload a .md file via drag-and-drop
Full table editor: Edit, transpose, deduplicate, find-and-replace before converting
Valid Ruby syntax: Output is directly executable Ruby code
Client-side processing: Files never leave the browser — zero data upload
Undo/Redo: Full edit history with revert support
Context menu: Right-click for quick row/column/cell operations
Header toggle: Treat the first row as a header or regular data
Validation indicator: Real-time feedback on input validity
Given this Markdown input:
| name | age | city |
|-------|-----|-------------|
| Alice | 30 | New York |
| Bob | 25 | Los Angeles |
The tool generates a Ruby array of hashes:
[
{ "name" => "Alice", "age" => "30", "city" => "New York" },
{ "name" => "Bob", "age" => "25", "city" => "Los Angeles" }
]
When First Row as Header is disabled, the output is an array of arrays:
[
["name", "age", "city"],
["Alice", "30", "New York"],
["Bob", "25", "Los Angeles"]
]
| Mode | Output Structure | When to Use |
|---|---|---|
| Header on (default) | Array of hashes with string keys | Rails seed data, fixtures, structured records |
| Header off | Array of arrays | Raw data, matrices, positional data |
Ruby arrays are ordered, integer-indexed collections of any object type. They are created with square bracket literal syntax:
numbers = [1, 2, 3, 4, 5]
names = ["Alice", "Bob", "Charlie"]
mixed = [1, "two", 3.0, :four, nil]
Key characteristics:
Dynamic size: Arrays grow and shrink automatically
Mixed types: A single array can hold integers, strings, hashes, and nil
Rich API: Over 100 built-in methods (map, select, reject, flatten, group_by, etc.)
Iterables: Native each, map, and each_with_index iteration
Official docs: ruby-doc.org/core/Array
Ruby hashes (used in header mode output) are key-value collections:
person = { "name" => "Alice", "age" => 30 }
# or with symbol keys:
person = { name: "Alice", age: 30 }
| Scenario | Why Convert |
|---|---|
Rails seed data (db/seeds.rb) | Populate database tables from documentation |
| Test fixtures | Convert example data from README into test data |
| Configuration data | Move tabular config from docs into Ruby constants |
| Data migration scripts | Transform documented data into executable migration code |
| Gem development | Generate sample data arrays for gem documentation |
| Jekyll/Hugo static sites | Convert data tables into Ruby data files |
| Code interviews | Quickly convert example tables into runnable Ruby code |
# db/seeds.rb
users = [
{ "name" => "Alice", "age" => "30", "city" => "New York" },
{ "name" => "Bob", "age" => "25", "city" => "Los Angeles" }
]
users.each do |user|
User.create!(user)
end
# config/data.rb
COUNTRIES = [
["US", "United States"],
["CA", "Canada"],
["MX", "Mexico"]
].freeze
No. All file parsing and conversion runs in your browser using JavaScript. Your data stays on your device. A.Tools never receives, stores, or transmits your file contents.
The tool supports standard pipe-delimited Markdown tables following the CommonMark specification, including tables with or without leading/trailing pipes and alignment indicators.
With First Row as Header enabled, the output is an array of hashes with string keys. With it disabled, the output is an array of arrays.
Yes. The generated code is valid Ruby 2.x and 3.x syntax. You can paste it directly into any .rb file, IRB session, or Rails console.
Yes. After parsing, the full table editor lets you modify cells, add or remove rows and columns, transpose, deduplicate, change text case, and find-and-replace values.
No. All values are output as Ruby strings. This preserves the original data exactly. Convert types in your Ruby code as needed using .to_i, .to_f, or .to_sym.
Processing is client-side, so the limit depends on your browser's memory. Tables with tens of thousands of rows work reliably on modern browsers.
Yes. The array-of-hashes format is directly compatible with Model.create!() loops in db/seeds.rb. See the "Use Cases" section above for an example.