CPU Utilization Calculator
Calculate CPU utilization percentage from raw /proc/stat jiffies counters (user, nice, system, idle, iowait, irq, softirq, steal).
Inputs
CPU Usage
31.72%
Idle
66.08%
I/O Wait
2.20%
Total Jiffies (sum of all counters)
22,700
Step by step
Values used
user = 5,000; nice = 100; system = 2,000; idle = 15,000; iowait = 500; irq = 50; softirq = 50; steal = 0
CPU usage percentage
usage% = 100 × (user+nice+system+irq+softirq+steal) / (user+nice+system+idle+iowait+irq+softirq+steal)
CPU Usage
= 31.72
Idle
= 66.08
I/O Wait
= 2.20
Total Jiffies (sum of all counters)
= 22,700
How it works
The Linux kernel exposes cumulative CPU time counters in /proc/stat, measured in jiffies since boot. Taking two snapshots and computing the delta of each field (or using cumulative totals as a rough single-point estimate, as here) lets you derive utilization: the busy time is user + nice + system + irq + softirq + steal, and total time additionally includes idle and iowait. Dividing busy by total gives the percentage of CPU time spent doing work.
Formula
CPU usage percentage
usage% = 100 × (user+nice+system+irq+softirq+steal) / (user+nice+system+idle+iowait+irq+softirq+steal)
- u
- user
- n
- nice
- s
- system
- i
- idle
- w
- iowait
- q
- irq
- f
- softirq
- t
- steal
Frequently Asked Questions
Should I use cumulative counters or deltas between two samples?
For an accurate instantaneous reading, take two /proc/stat snapshots a second or two apart and feed the *differences* of each field into this calculator — that is what `top` and `mpstat` do internally. Using raw cumulative totals from boot gives an average over the machine's entire uptime.
What does the steal field represent?
Steal time is CPU time a virtual machine's guest OS was ready to run but the hypervisor gave the physical CPU to another guest instead — a useful signal of noisy-neighbor contention on shared virtualized or cloud hosts.
Why is iowait excluded from busy time?
iowait represents idle time where the CPU had no runnable task but was waiting on a pending disk I/O — the CPU wasn't actually executing instructions, so it counts toward idle capacity, not utilization.