JSON to MDF
Convert JSON to MDF by declaring a SQL Server table, checking the mapped values, and downloading the new data file.
- Free
- Works Offline
- No Uploads
How to Convert JSON to MDF
- Open the HTML, review Security Check, then select Continue.
- Choose a UTF-8 JSON array or select Open Sample.
- Enter the dbo table name. Review the proposed SQL columns and adjust their types, widths, nullability, and optional integer primary key. For the sample, enable Allow Missing as SQL NULL for Price.
- Select Review Mapping. Check the mapped declarations, row preview, and any rejected values. Select Create MDF when the review is clear, then Download MDF.
- Attach a scratch copy to SQL Server 2025 Express LocalDB using CREATE DATABASE [JsonImport] ON (FILENAME = N'C:\Temp\Orders.mdf') FOR ATTACH_REBUILD_LOG. Replace the example path with your copy. Run DBCC CHECKDB (N'JsonImport') and query the mapped dbo table.
JSON to MDF Features
- Review proposed SQL types, declared widths and precision before writing.
- Keep exact numeric values, including 9007199254740993 and decimal 120.3500.
- Inspect rejected records and choose explicitly whether missing properties should become SQL NULL.
Formats and Compatibility
| Input | A UTF-8 .json file containing a nonempty array of records. Map scalar fields or exclude fields with nested values. |
|---|---|
| Output | A SQL Server 2025 primary .mdf with one explicitly mapped dbo table and its rows. Native attachment was tested with SQL Server 2025 Express LocalDB 17.0.4025.3. |
| Browser | A modern browser with local file support. |
| Scope | Creates one new dbo table per UTF-8 JSON file. Inputs are limited to 32 MiB and 1,024 distinct fields. Exact integers and decimals, booleans, and Unicode text are supported, with an optional integer primary key. The writer is bounded by declared row width, storage capacity, and a 60 MiB typed-row budget. Native attachment was tested on SQL Server 2025 Express LocalDB 17.0.4025.3. |
| Operating Systems |
Local Processing Without Uploads
Use JSON to MDF without uploading files. This browser-based tool reads the local file and builds the MDF on your device with no upload.
Select The Orders sample has an exact price of 120.3500, one record with a missing price, and one explicit null. Enable Allow Missing as SQL NULL for Price to create the file. Native SQL Server checks verified both NULL values and all three rows. to see the workflow with the included example.
From JSON Records to a SQL Server Table
Create MDF from JSON by mapping properties to named SQL columns. The review reports missing properties and explicit JSON null separately. If you approve both for a nullable column, the database stores both as SQL NULL.
Attach the MDF in SQL Server
Open a connection to SQL Server 2025 and attach a scratch copy of the MDF with CREATE DATABASE ... FOR ATTACH_REBUILD_LOG. Run DBCC CHECKDB and query the dbo table to confirm the row count and values. The engine recreates the transaction log during attach.
Frequently Asked Questions
Can I use JSON to MDF offline?
Yes. Extract the tool ZIP and open JSONToMDF.html. The standalone tool builds the file in your browser with internet access disabled.
Where is the JSON to MDF download?
Use Download Tool ZIP to keep the standalone converter. After creating the file, use Download MDF to save your output separately.
How does a local JSON to MDF conversion handle exact numbers?
The converter keeps the original JSON number tokens during validation and rejects out-of-range values or declarations that would round a number.
Is there a free JSON to MDF converter?
Yes. The standalone converter is available under the Local Studio Free Software License.
How does JSON to MDF in browser mode handle nested fields?
A selected field containing an object or array blocks creation. The review names the record and field. Exclude the field or correct the input and review again.
How do I convert a JSON to SQL Server database file and open it?
Declare the table and columns, save the .mdf, then attach a scratch copy in SQL Server. The attachment and DBCC CHECKDB workflow was verified on SQL Server 2025 Express LocalDB.
Are missing properties the same as explicit JSON null?
Review counts them separately. Explicit JSON null requires a nullable column. A missing property requires that column to be nullable and Allow Missing as SQL NULL to be selected. If both are approved, both become SQL NULL.
Which SQL types and schema features are included?
Use TINYINT, SMALLINT, INT, BIGINT, DECIMAL, NUMERIC, BIT, and NVARCHAR with a declared width or MAX. Foreign keys, secondary indexes, triggers, views, and server settings are outside this converter.
Does this tool work offline on Windows, macOS, Linux, and ChromeOS?
Yes. Local Studio tools run offline on Windows, macOS, Linux, and ChromeOS. Download the tool ZIP, extract it, and open the included HTML file in a supported browser. Your files are processed on your device without uploads.
Which browsers can I use with this offline tool?
Use a current version of Google Chrome, Microsoft Edge, Mozilla Firefox, or Safari where that browser is available for your operating system. Chrome is built into ChromeOS, and Safari is available on macOS.