Convert a column type between PostgreSQL, MySQL, SQLite and SQL Server, with each conversion marked exact or approximate and TypeScript and Zod beside it.
Enter a type
Write it as you would in your DDL, length and all.
Enter a type
Write it as it appears in your DDL.
SQL Data Type Converter runs entirely on your device — nothing is uploaded, and no database is contacted.
You’re on the Free plan. Compare plans
Every conversion is labelled exact or approximate, because most of them are approximate and a converter that hides that is worse than none at all. PostgreSQL's `TIMESTAMPTZ` has no MySQL equivalent that behaves the same way. MySQL's `TINYINT(1)` is what you write for a boolean and is not one. SQLite has five storage classes and will accept any type name you care to invent.
Those differences are declared per type rather than inferred from spelling, because comparing names gets it backwards in both directions: MySQL's `INT` really is an integer despite the shorter word, while its `TINYINT(1)` really is not a boolean despite being the conventional spelling of one.
The TypeScript and Zod output is approximate by nature and says so. A 64-bit integer does not fit in a JavaScript number, and `DECIMAL` is not a float — both come back with the caveat attached rather than a confident `number` that silently loses precision somewhere downstream.
Each type carries the thing that catches people out. `VARCHAR(255)` is a historical artefact rather than a meaningful limit in PostgreSQL, where `TEXT` has no performance cost. `JSON` and `JSONB` differ in whether the input is preserved byte for byte. `CHAR` pads with spaces, which is almost never what anyone wants.
The reference view lists every type by category with the same notes, which is the faster route when you are choosing a type rather than converting one.
There isn't a true one. MySQL's `TIMESTAMP` converts to UTC on write and back to the session time zone on read, which is similar in effect and different in mechanism; `DATETIME` stores no zone at all. The conversion is reported as approximate because the behaviour genuinely differs.
In PostgreSQL, `TEXT` — there is no performance difference and the 255 is a historical artefact from MySQL index limits. In MySQL the choice matters more, because `TEXT` is stored differently and cannot have a default.
`JSON` stores the text as given, preserving whitespace, key order and duplicate keys. `JSONB` stores a parsed binary form, which is faster to query and indexable, and does not preserve any of that. For almost every use, JSONB.
Because a JavaScript number holds 53 bits of integer precision and a BIGINT holds 64. Values past 2^53 lose precision silently, which is why ids returned as BIGINT are often serialised as strings.
Effectively, yes. It has five storage classes and applies type affinity rules to whatever name you write, so `CREATE TABLE t (x BANANA)` is valid. That flexibility is why a schema written for SQLite often needs real review before it moves to another engine.