.XNB

XNB File

XNA Game Studio Compiled Content
Ask a question
QUICK ANSWER

An XNB file is a compiled game asset produced by Microsoft's XNA Framework or its successors MonoGame and FNA - a texture, sound, font, model, or data table packed for fast loading. You find them in the Content folder of games like Terraria and Stardew Valley. There is no standard double-click viewer; use a community unpacker like xnbcli to extract the contents to PNG, WAV, or JSON.

Developer: Microsoft (XNA Game Studio / Content Pipeline) Category: Game Files MIME: application/octet-stream
OPENS ON Windows macOS Linux
Related: .OBB · .PAK · .ROFL · .PACKAGE

On this page

19k+ extensions indexed
Last reviewed Aug 29, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the XNB file format?

.xnb is a compiled binary file that stores a single game resource produced by the XNA Game Studio Content Pipeline. .xnb is a binary format and can contain images, audio data, 3D models, fonts, and many other resources. Source assets such as .png textures or .wav audio clips are compiled at build time into platform-optimized .xnb files that the game loads at runtime via Content.Load<T>().

Every .xnb file opens with the ASCII tag XNB, followed by a target-platform byte (w for Windows, x for Xbox 360, m for Windows Phone) and a format-version byte. An optional LZX or LZ4 compression flag is encoded in the same header.

XNA is a set of development tools for creating games for Microsoft Windows, Windows Phone, and Xbox systems. The XNA development environment was based on Visual Studio Express and was available for free, offering a rich set of tools and features for game developers. Microsoft discontinued XNA with version 4.0 in 2010, ending support around 2014. The open-source MonoGame and FNA frameworks continue to read and write the same .xnb format, keeping it relevant for titles like *Terraria*, *Stardew Valley*, and *Celeste*, which ship their art and audio as .xnb files.

Third-party tools, including xnbcli and XnbExtract, can unpack .xnb content back into editable source assets. Related XNA audio bank files use the .xsb and .xwb extensions.

Security & safety

RISK: LOW

An XNB is inert compiled game data - a texture, sound or data table - with no scripting or executable content, so opening or extracting one is not dangerous in itself. Two practical cautions: extracting or redistributing a game's assets is governed by that game's copyright/EULA (fine for personal mods, not for redistribution), and you should download XNB tools from their official repositories (GitHub) rather than random "xnb opener" sites, which are often ad/PUP traps since no legitimate standalone double-click viewer exists.

Format details

in a nutshell
FULL NAMEXNA Game Studio Compiled Contentaka XNB content file, XNA Framework binary
DEVELOPERMicrosoft (XNA Game Studio / Content Pipeline)since 2006 (XNA Game Studio Express / XNA Framework 1.0)
CATEGORYGame Files
MIME TYPEapplication/octet-stream
TYPEBinary compiled game asset (texture, audio, model, font, sprite, etc.)
MAGIC BYTES · FILE SIGNATURE
OFFSET
000102
HEX
584E42
ASCII
XNB
Every XNB begins with the ASCII tag "XNB" (58 4E 42). Byte 3 is the target platform: 'w' (0x77) Windows, 'm' (0x6D) Windows Phone/Mobile, 'x' (0x78) Xbox 360. Byte 4 is the format version (5 for XNA 4.0). Byte 5 is a flags byte whose high bit marks LZX/LZ4 compression of the payload that follows the header.

Programs that open XNB files

Windows3 apps
XNB extractors (XnbExtract / xnbcli / XNB Exporter) Open-source Drag .xnb files onto the tool to unpack them into PNG/WAV/JSON; repack edited assets back to .xnb. The realistic way to view or mod XNB content. xnbcli is actively maintained.
Microsoft XNA Game Studio (legacy) Free The original toolset that BUILDS .xnb via the Content Pipeline (needs Visual Studio). Legacy/unsupported; install only for historical or development work, not to 'view' a file. The db-recommended entry.
MonoGame Content Builder (MGCB) Open-source The maintained successor to the XNA Content Pipeline - compiles source assets into .xnb and is used by developers building MonoGame games today.
macOS1 app
xnbcli Open-source Cross-platform Node-based unpacker/repacker; run it from the terminal to extract .xnb assets to PNG/WAV/JSON on macOS.
Linux1 app
xnbcli Open-source Cross-platform; unpack/repack .xnb from the terminal. The standard modding tool on Linux.

Technical details

deep spec
File encodingBinary, little-endian byte order
Magic bytes0x58 0x4E 0x42 (ASCII "XNB") at offset 0
Header layout3-byte ASCII tag "XNB" + 1-byte platform code + 1-byte format version + 1-byte flags + 4-byte total file size (little-endian uint32)
Platform codes'w' (0x77) = Windows, 'x' (0x78) = Xbox 360, 'm' (0x6D) = Windows Phone/Mobile - encoded in byte 3 of every header
Format versionVersions 1-5; version 5 corresponds to XNA Game Studio 4.0 and is the version targeted by MonoGame and FNA
CompressionOptional - LZX (XNA 4.0) or LZ4 (some MonoGame builds); signalled by a flag bit in the header flags byte; payload is often stored uncompressed
Content types supportedTextures (DXT1/DXT3/DXT5/Color RGBA), audio (PCM/ADPCM), 3D models, bitmap fonts, compiled effect shaders, sprite sheets
Type-reader manifestHeader embeds a serialized list of ContentTypeReader class names the runtime uses to deserialize the asset object graph
Assets per fileOne primary asset per .xnb file; shared sub-resources are nested within the same file's serialized object graph
Texture surface formatsColor (32-bit RGBA), DXT1 (opaque 4:1 block-compressed), DXT3, DXT5 - GPU-native formats that reduce VRAM footprint at load time
Typical file sizeA few KB for small fonts or sprites; up to tens of MB for high-resolution textures or uncompressed audio tracks
Integrity checkTotal file size stored as a 4-byte little-endian field in the header for basic validation; no cryptographic checksum or hash is included
EncryptionNot encrypted - compiled assets are stored as plain binary data readable by any implementation that supplies the correct ContentTypeReader
MIME typeapplication/octet-stream (no dedicated MIME type registered for .xnb)
Content Pipeline roleRuntime output of the XNA/MonoGame Content Pipeline - source files (.png, .wav, .fbx, .spritefont) are compiled at build time into .xnb and loaded at runtime via Content.Load<T>()
Notable adoptersMonoGame and FNA (open-source XNA successors); used to ship assets in Terraria, Stardew Valley, Bastion, Fez, and Celeste
Released2006 (XNA Game Studio Express / XNA Framework 1.0)
Latest versionXNB format 5 (XNA Game Studio 4.0, 2010); same format reused by MonoGame/FNA
Specificationen.wikipedia.org

XNB conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with XNB files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about XNB files.

Frequently asked questions

What is an XNB file?
A compiled game asset from Microsoft's XNA Framework (or its successors MonoGame/FNA) - a texture, sound, font, model or data table packed for fast loading. You find them in the Content folder of games like Terraria and Stardew Valley.
How do I open or view an XNB file?
There's no normal double-click viewer. Use a community extractor like xnbcli or XnbExtract to unpack the .xnb into a PNG, WAV or JSON you can view, then repack if you're modding.
How do I edit an XNB file (mod a game)?
Unpack it with xnbcli to get the source asset (e.g. a PNG), edit that, then repack it to .xnb and drop it back into the game's Content folder. Some games offer modern modding APIs that read PNG/JSON directly instead.
Why won't my XNB file open in an image or audio player?
Because it's not a standard image or audio file - it's an XNA-compiled container with a type manifest the game's code understands. Extract it first with an XNB tool to get a normal PNG/WAV.
Can I still work with XNB files in 2026?
Yes. XNA itself is discontinued, but the open-source MonoGame and FNA frameworks still build and load .xnb, and maintained tools like xnbcli unpack and repack them.
What's the difference between .xnb and .xna?
.xnb is the compiled binary content the game loads; XNA is the framework/toolset that produces it. (.xna isn't a common asset extension - the asset files are .xnb.)

References

1Wikipedia - Microsoft XNAen.wikipedia.org
2MonoGame - Content Pipeline documentationdocs.monogame.net

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.DATProgram Data File (generic)
4.PARTPartial Download File
5.EXEWindows Executable (Portable Executable)
6.RPMSGRestricted Permission Message
7.BINCD/DVD Disc Image (BIN/CUE)
8.DLLDynamic Link Library
9.XDWDocuWorks Document
10.JPGJPEG Image

Related extensions

.OBBAndroid Opaque Binary Blob (APK Expansion File)
.PAKGame Resource Package (PAK)
.ROFLLeague of Legends Replay
.PACKAGEThe Sims / Maxis DBPF Package (game content & mods) - dominant meaning
.XSBXACT Sound Bank
.SAVSaved Game File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z