A fast, lightweight command-line tool written in C# for working with Minecraft's NBT (Named Binary Tag) files. Convert .dat / .nbt files to human-readable JSON (and back), search inside them, edit values, validate files, and inspect player or structure data, all from your terminal.
- NBT → JSON: convert any
.dat/.nbtfile to pretty-printed JSON - JSON → NBT: convert JSON back into a GZip-compressed NBT file (
--jsontonbt) - Batch export: convert a whole folder tree to JSON while preserving the folder structure
- Batch import: convert every
.jsonfile in a folder back to.dat - Search: find tags by name or value (case-insensitive, recursive)
- Edit values: change a tag's value directly from the command line, with type-checked input and an automatic backup of the original
- File info: size, root tag name/type and compression type
- Structure summary: dimensions and block count for structure
.nbtfiles - Player summary: health, food level, XP level and position from
playerdata/level.datstyle files - Validation: check whether an NBT file is readable and structurally sound
- Safe by default: the original file is backed up once as
.bak(never overwritten by later edits), and files are written to a temporary file first, so a failed write can't leave you with a half-written file - Script friendly: exit code
0on success and1on errors - Colored console output (
[INFO],[SUCCESS],[ERROR])
Grab the latest ready-to-use build from the Releases page and extract the .zip file to any folder.
The zip contains:
| File | Purpose |
|---|---|
NBTEditor.exe |
The program itself |
NBTEditor.dll |
Main application library |
fNbt.dll |
NBT reading/writing library (required) |
NBTEditor.deps.json |
Dependency information |
NBTEditor.runtimeconfig.json |
.NET runtime configuration |
NBTEditor.runtimeconfig.dev.json |
Development runtime configuration (optional) |
NBTEditor.pdb |
Debug symbols (optional) |
Note:
fNbt.dllis already included in the zip, so there is nothing else to download or install except the .NET runtime below.Important: Keep all files together in the same folder.
NBTEditor.exewill not work withoutNBTEditor.dll,fNbt.dlland the.jsonconfiguration files next to it.
- Windows
- .NET 10.0 Runtime (required). This project is built with .NET 10.0, so older versions will not work. If you get a ".NET is required" message when starting the program, install the runtime from the link. Only the Runtime is needed, not the SDK.
NBTEditor is a command-line tool, so run it from a terminal rather than by double-clicking:
- Extract the zip to a folder, for example
C:\NBTEditor. - Open that folder, click the address bar, type
cmdand press Enter. This opens a terminal in the folder. - Run a command:
NBTEditor.exe level.dat -o level.jsonTip: put the file you want to convert in the same folder, or give the full path, for example NBTEditor.exe "C:\Users\You\saves\World\level.dat" -o level.json. Use quotes if the path contains spaces.
Running NBTEditor.exe with no arguments prints the help text.
NBTEditor <file>.dat_or_nbt -o <file>.json
NBTEditor --jsontonbt <file>.json -o <file>.dat_or_nbt
NBTEditor <file>.dat_or_nbt --find "SearchQuery"
NBTEditor <file>.dat_or_nbt --set "TagName" "NewValue"
NBTEditor <file>.dat_or_nbt --info
NBTEditor <file>.nbt --structure
NBTEditor <file>.dat --player
NBTEditor <file>.dat --validate
NBTEditor --all <directory_path>
NBTEditor --export-all <directory_path>
Running the program without arguments prints this help text. In the examples below, NBTEditor means NBTEditor.exe on Windows.
| Command | Description |
|---|---|
<file> -o <out.json> |
Convert an NBT file to JSON |
--jsontonbt <file.json> -o <out.dat> |
Convert JSON to a GZip-compressed NBT file (an existing output file is backed up as .bak first) |
<file> --find "<query>" |
Search tag names and values (case-insensitive) |
<file> --set "<tag>" "<value>" |
Update the first tag with the given name (a .bak backup of the original is created first) |
<file> --info |
Show file size, root tag name/type and compression |
<file> --structure |
Show size (X × Y × Z) and block count of a structure file |
<file> --player |
Show health, food level, XP level and position |
<file> --validate |
Check whether the file can be read correctly |
--all <dir> |
Convert all .json files in a directory to .dat (existing .dat files with the same name are overwritten) |
--export-all <dir> |
Convert all .dat / .nbt files in a directory (recursively) to JSON |
Convert level.dat to JSON
NBTEditor level.dat -o level.jsonConvert the JSON back to NBT
NBTEditor --jsontonbt level.json -o level.datSearch for a tag or value
NBTEditor level.dat --find "LevelName"[MATCH #1] Tag Name: 'LevelName' (Type: String) | Value: 'My World'
Change a value
NBTEditor level.dat --set "LevelName" "My New World"A backup (level.dat.bak) is created automatically the first time you edit a file. An existing .bak is never overwritten, so it always keeps your original file. The value must match the tag's type: for example, you can't put text into an Int tag, and in that case the file is left unchanged and an error is shown. Decimal numbers always use a dot (1.5), regardless of your system language.
Show a player summary
NBTEditor player.dat --player--- PLAYER SUMMARY ---
Health : 20
Food Level: 20
XP Level : 5
Position : X: 120.50, Y: 64.00, Z: -35.25
----------------------
Export an entire folder to JSON
NBTEditor --export-all ./worldThis creates Output-world next to the source folder, mirroring the original folder structure. Each file is saved with .json appended, for example level.dat → level.dat.json.
| NBT type | JSON output |
|---|---|
| Compound | Object |
| List | Array |
| Byte / Short / Int / Long | Number |
| Float / Double | Number |
| String | String |
| Byte Array | Array of numbers (signed, -128 to 127) |
| Int Array / Long Array | Array of numbers |
| JSON type | NBT output |
|---|---|
| Object | Compound |
| Array | List |
| String | String |
| Number | Int, or Long if it doesn't fit, or Double for decimals |
true / false |
Byte (1 / 0) |
Special handling for common Minecraft tags:
UUID→ Int ArrayPos,Motion→ List of DoublesRotation→ List of Floats- Any other array that contains only numbers with at least one decimal value → List of Doubles
Tag names Pos, Motion and Rotation are case-sensitive.
--jsontonbt writes GZip-compressed files, which is the format Minecraft uses for level.dat and player data. JSON files up to 512 levels deep are supported.
- JSON has no equivalent for every NBT type, so a round trip (NBT → JSON → NBT) can change some tag types (for example Byte/Short/Float values come back as Int/Double, and Byte/Long arrays come back as Lists).
--setsupports Byte, Short, Int, Long, Float, Double and String tags only, and updates the first tag found with the given name (the search is case-insensitive).--allonly processes.jsonfiles in the given directory (not subdirectories).- Always keep a backup of your world before editing or re-importing data, and close Minecraft before modifying world files.
Contributions, issues and feature requests are welcome. Feel free to open an issue or submit a pull request.
- Fork the project
- Create your branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m "Add my feature") - Push the branch (
git push origin feature/my-feature) - Open a pull request
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.
- fNbt: NBT reading/writing library
- Minecraft is a trademark of Mojang AB. This project is not affiliated with or endorsed by Mojang or Microsoft.s
- fNbt: NBT reading/writing library
- Minecraft is a trademark of Mojang AB. This project is not affiliated with or endorsed by Mojang or Microsoft.