Free SQL to JSON Converter
Convert SQL CREATE TABLE statements to JSON schema. Instantly extract column names, types, and constraints.
About SQL to JSON Conversion
This tool parses SQL CREATE TABLE statements and converts them to JSON schema format. It extracts column names, data types (INT, VARCHAR, TEXT, BOOLEAN, DATE, TIMESTAMP, DECIMAL), and constraints (NOT NULL, PRIMARY KEY, DEFAULT values). The JSON output is suitable for API documentation, database design, or migration tools.
Supported SQL Data Types
- INT / INTEGER · 32-bit integer values
- VARCHAR(n) · Variable-length text with max length
- TEXT · Unlimited-length text
- BOOLEAN / BOOL · True/false values
- DATE · Calendar dates without time
- TIMESTAMP · Date and time with timezone support
- DECIMAL(p,s) · Precise decimal numbers
Frequently Asked Questions
What SQL dialects are supported?
This converter handles standard SQL syntax used by MySQL, PostgreSQL, SQL Server, and SQLite. Dialect-specific features may not be fully recognized.
Can it handle complex constraints?
The converter recognizes NOT NULL, PRIMARY KEY, DEFAULT, and basic type information. Complex constraints like CHECK or FOREIGN KEY are stored as text annotations.
Can I use the JSON output directly?
Yes! The JSON output is formatted for readability and can be used in API schemas, TypeScript interfaces, or documentation generators.