Format:NCA
| Vendor | Nintendo |
|---|---|
| Magic | 4E 43 41 33 ("NCA3") at 0x200 of the decrypted header (older: NCA2, NCA0) |
| Extensions | .nca |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Nintendo Switch content archive (.nca): a 0xC00-byte header (0x400 main header plus four 0x200 FS section headers) stored encrypted, whose decrypted form has the magic NCA3 at offset 0x200, followed by up to four sections that hold a PFS0 or RomFS filesystem.
Overview
An NCA is the unit of content in a Switch title: a program (code and data), a control (icon and Format:NACP), a manual, public data, or a meta NCA that lists the others. NCAs are the files stored in an NSP and in the secure partition of an Format:XCI. Every section is a PFS0 (ExeFS, logo) or a RomFS.
Recognition
The header is not readable in a stored file: hactool declares nca_decrypt_header and an is_decrypted flag, so a normal NCA begins with ciphertext and the string NCA3 is not visible in it. After decryption (keys are not documented on this wiki) the header is 0xC00 bytes: 0x400 for the main header, then four FS section headers of 0x200 bytes. The first 0x200 bytes are two 0x100-byte RSA signatures, so the magic NCA3 sits at 0x200. Unverified: the header cipher is AES-XTS (the Atmosphere enum names DecryptionKey_AesXts for key slot 0, but the header use is not read here).
Magics seen in the sources: NCA0, NCA1 (Atmosphere only), NCA2, NCA3; hactool treats NCA0 as a beta format with its own RomFS layout.
Header
See Fact:NCA/struct/NCA header. The content type enum of the NCA header (Program 0, Meta 1, Control 2, Manual 3, Data 4, PublicData 5) is not the same enum as the content type that the content manager (ncm) uses for the same files; see Fact:NCA/enum/NCA header content type, Fact:NCA/enum/ncm content type and content meta type and Fact:NCA/enum/ncm content meta type.
Each of the four FS entries gives start and end sector in 0x200-byte units; a section is at start_sector * 0x200. The 0x100-byte encrypted key area at 0x300 and the rights ID at 0x230 decide how the section keys are obtained; that is key handling and is not covered here.
FS section header
0x200 bytes each, see Fact:NCA/struct/NCA FS header and Fact:NCA/enum/NCA FS header types. Atmosphere (libstratosphere) names byte 2 fs_type (RomFs 0, PartitionFs 1) and byte 3 hash_type; hactool's nca_fs_header_t calls the same two bytes partition_type (0 RomFS, 1 PFS0) and fs_type (2 PFS0, 3 RomFS) and its values 2 and 3 are the hash types HierarchicalSha256Hash and HierarchicalIntegrityHash. Read one tool's names with its own enum.
Related
Format:PFS0 and HFS0, Format:RomFS (Switch), Format:NPDM, Format:NSO, Format:NACP, Platform:Nintendo Switch.
Code & repositories
See below.
- https://github.com/Atmosphere-NX/Atmosphere @
6b0c077b4c608a3a2ee712b8dc35fee87ceb62e8· license: GPL-2.0
Atmosphere (GPL-2.0-or-later): libstratosphere fssystem_nca_header.hpp (NCA header), ncm_content_type.hpp, kern_k_initial_process_reader.hpp (KIP1), kern_k_capabilities.hpp (kernel capability descriptors).
Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-16; Note: the latest release ships binaries; the wiki links only the source, never the binaries - https://github.com/SciresM/hactool @
1d64a83450e025622f3468c28fc4164dad2c5ef6· license: ISC
hactool (ISC): nca.h defines nca_header_t, nca_fs_header_t and the content type enum.
Tested on: source read, not run · checked 2026-10-19; last activity 2023-12-04; Note: the latest release ships binaries; the wiki links only the source, never the binaries