High Efficiency (Modern AMD Ryzen / Intel Core)
Standard Efficiency (Older Quad-Core/Laptop)
Low Efficiency (Server/Budget CPUs)
Note: This varies by mining algorithm (e.g., RandomX).
Crucial for RandomX: Generally requires 2MB per thread.
Estimated Performance:
0 H/s
Kilohashes: 0 KH/s
Theoretical Daily Hashes: 0
function calculateHashrate() {
var cores = parseFloat(document.getElementById('numCores').value);
var clock = parseFloat(document.getElementById('clockSpeed').value);
var ipc = parseFloat(document.getElementById('instructionsPerCycle').value);
var cache = parseFloat(document.getElementById('l3Cache').value);
if (isNaN(cores) || isNaN(clock) || isNaN(ipc) || isNaN(cache)) {
alert("Please enter valid numbers in all fields.");
return;
}
// Basic Hashrate Logic for CPU Mining (Based on RandomX/Monero style estimation)
// Logic: Hashrate is a function of (Cores * Clock * IPC) but limited by Cache
// Ideal cache for RandomX is 2MB per core/thread.
var threadLimit = cache / 2;
var activeThreads = Math.min(cores, threadLimit);
// Base Hashrate Formula: Cores * ClockSpeed * EfficiencyFactor
// Efficiency factor here is IPC-based. 100 IPC ~ 100 H/s per GHz.
var estimatedHashrate = activeThreads * clock * ipc;
// Display Results
document.getElementById('hashRateVal').innerText = estimatedHashrate.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('khsVal').innerText = (estimatedHashrate / 1000).toLocaleString(undefined, {minimumFractionDigits: 4, maximumFractionDigits: 4});
document.getElementById('dailyHashes').innerText = (estimatedHashrate * 86400).toLocaleString();
// Cache Warning Logic
var warningEl = document.getElementById('cacheWarning');
if (threadLimit < cores) {
warningEl.style.display = "block";
warningEl.innerText = "Warning: Your L3 Cache is insufficient to utilize all " + cores + " cores efficiently. The calculation is throttled to " + threadLimit + " cores.";
} else {
warningEl.style.display = "none";
}
document.getElementById('resultArea').style.display = "block";
}
How to Calculate CPU Hash Rate
Calculating the hash rate of a CPU involves understanding how many mathematical computations (hashes) the processor can solve per second. Unlike GPUs, which rely on massive parallelism, CPU hashing performance is heavily dependent on single-core efficiency, memory latency, and particularly L3 Cache size.
The CPU Hash Rate Formula
While every mining algorithm (like RandomX, GhostRider, or Yespower) is different, the general formula for estimating CPU performance is:
Effective Cores: This is not always your total core count. For algorithms like RandomX, you need roughly 2MB of L3 cache per mining thread. If you have an 8-core CPU but only 8MB of L3 cache, you can only effectively use 4 cores for mining.
Clock Speed: The frequency at which your CPU operates. Higher clock speeds allow for more cycles per second, directly increasing hashrate.
IPC (Instructions Per Cycle): This represents the architectural efficiency. A modern Zen 4 or Raptor Lake processor will produce significantly more hashes per GHz than an older FX-series or Ivy Bridge processor.
Real-World Example Calculation
Let's look at a popular mining CPU: the AMD Ryzen 9 5950X.
Cores: 16
Clock Speed: 4.0 GHz (All-core boost)
L3 Cache: 64 MB
Efficiency Factor: ~200 (for RandomX)
First, check the cache limit: 64MB / 2MB per thread = 32 threads. Since the 5950X has 16 cores/32 threads, it is not cache-limited.
RAM Speed and Latency: CPU mining is often "memory-bound." Faster RAM (DDR5 vs DDR4) and lower CL latencies can increase hashrate by up to 20-30%.
Thermal Throttling: If the CPU gets too hot, it will drop its clock speed, causing the hash rate to plummet.
Background Processes: Since CPU mining uses the system's primary processor, running browsers or other software while mining will significantly reduce the output.