DevToolBox

JSON to Lua Converter

Convert JSON data to Lua table literals with full nesting support

JSON Input

Lua Output

Conversion Rules

  • Objects: Converted to Lua tables with key-value pairs
  • Arrays: Converted to Lua tables with numeric indices (1-based)
  • Strings: Wrapped in double quotes with escaped special characters
  • Numbers: Direct conversion
  • Booleans: Converted to Lua true/false
  • null: Converted to Lua nil
  • Keys: Valid identifiers used as-is, others wrapped in brackets

Example

JSON
{
  "name": "John",
  "age": 30,
  "active": true
}
Lua
{
  name = "John",
  age = 30,
  active = true
}