DevToolsHub Free · Fast · 100% in your browser

SQL to C# Class

Generate C# classes or records from SQL CREATE TABLE statements (SQL Server, PostgreSQL, MySQL, SQLite).

About this SQL to C# class generator

Generate C# classes or records from SQL CREATE TABLE statements. Column types from SQL Server, PostgreSQL, MySQL and SQLite are mapped to C# types, and nullable columns become nullable properties, ideal for Entity Framework Core or Dapper models.

How to use the SQL to C# Class

  1. Paste one or more CREATE TABLE statements.
  2. Choose class or record output.
  3. Copy the generated C# code.

Example

CREATE TABLE Users (Id INT NOT NULL, Name NVARCHAR(50) NULL)  →  public class Users { public int Id { get; set; } public string? Name { get; set; } }

Frequently asked questions

Which SQL types are supported?

Common numeric, text, date/time, boolean, GUID/uuid and binary types across the major databases are mapped to their C# equivalents.

Is my data safe?

Yes. The tool runs entirely in your browser using WebAssembly. Nothing you type or upload is sent to a server, logged or stored.

Is it free?

Yes, completely free with no sign-up, no limits and no watermarks. It also works offline once the page has loaded.

An unhandled error has occurred. Reload ✕
"token": "b6f3e467ae89404282beba5b41ef3630"