CPU Affinity Mask Calculator
Turn a hexadecimal CPU mask into a CPU list, or toggle CPUs to build the mask and copy the matching commands.
Copy-ready commands
taskset, CPU list form
taskset, hex mask form
Docker or Compose CPU set
systemd service unit
cgroup v2 cpuset controller
A mask is a bitmap of logical CPUs: bit n set means CPU n is allowed, and taskset -p prints the mask as a bare hexadecimal number with the lowest bit last. Leading zeros do not change a mask. This page models up to 1024 logical CPUs, the kernel's CPU_SETSIZE, with exact big-integer arithmetic, so 64-bit and larger masks are not truncated. Hyperthread siblings count as separate logical CPUs, so allowing CPU 0 and CPU 1 may pin a process to one physical core. A parent cpuset, the cgroup v2 cpuset.cpus file (comma-separated, ranges allowed, as generated here) or cpuset.effective_cpus can still reduce the set, and taskset rejects an empty mask. CPU numbering and the accepted syntax also depend on the kernel version and the tool reading it, so check the command against your own system. Commands are shown as text only; nothing is executed and nothing leaves your browser.