Total Harmonic Distortion Calculator - THD Percent, THD+R, and dB Attenuation

Use the total harmonic distortion calculator to read THD percent, distortion attenuation in dB, and THD+R ratio from a list of harmonic RMS amplitudes.

Updated: June 20, 2026 • Free Tool

Total Harmonic Distortion Calculator

RMS amplitude of the fundamental in volts. Must be greater than zero.

RMS amplitude of the second harmonic.

RMS amplitude of the third harmonic.

RMS amplitude of the fourth harmonic.

RMS amplitude of the fifth harmonic.

RMS amplitude of the sixth harmonic.

Distortion factor as a percentage (k = 100 x THD). Used with the converter panel.

Distortion attenuation in decibels. Always non-positive.

Results

THD (fundamental-referenced)
0%
THD+R (RMS-referenced) 0%
Distortion attenuation a_k 0dB
Harmonic RMS sum sqrt(V2^2 + V3^2 + ...) 0
k = 10^(a_k / 20) x 100 0%
a_k = 20 log10(k / 100) 0dB

What Is Total Harmonic Distortion Calculator?

A total harmonic distortion calculator reads a list of harmonic RMS amplitudes V1, V2, V3, ... and returns the standard distortion factors THD_F (fundamental-referenced) and THD_R (RMS-referenced) in percent, plus the distortion attenuation a_k in decibels.

  • Quantify amplifier distortion from a harmonic list: Type V1..V6 from a bench analyzer FFT and read THD percent alongside the dB attenuation.
  • Confirm the textbook values for square, sawtooth, and triangle waves: Check that a square wave reads THD_F = 48.3 %, a sawtooth reads 80.3 %, and a triangle reads 12.1 %.
  • Convert between distortion factor k and attenuation a_k: Move between percent and dB columns to convert k = 1 % to a_k = -40 dB, or a_k = -20 dB to k = 10 %.
  • Check a power-quality reading against IEEE 519 limits: Compare a measured THD percent against the IEEE Std 519-2022 limits the calculator surfaces.

This total harmonic distortion calculator is the standard single-number summary of how much a non-linear device (an amplifier, an inverter, a power supply) has reshaped a clean sine wave. In audio it appears as the THD percent on a datasheet; in power systems it is the same ratio on a 50 or 60 Hz mains waveform, where lower THD means less heating and less electromagnetic emission.

The 1/n coefficient on each harmonic amplitude V_n is the same 1/n pattern the Harmonic Series Calculator sums across the first n reciprocals of the harmonic series.

How Total Harmonic Distortion Calculator Works

The calculator squares each entered harmonic amplitude, sums those squares, takes the square root to get the harmonic RMS, and divides by the fundamental V1. The percent result is the fundamental-referenced distortion factor THD_F; the dB result is twenty times the log10 of THD_F. A second branch on the same form converts between percent and dB.

THD_F = sqrt(V2^2 + V3^2 + V4^2 + ...) / V1, THD_R = THD_F / sqrt(1 + THD_F^2), a_k = 20 log10(THD_F)
  • V1: RMS amplitude of the fundamental. Must be greater than zero; the form rejects V1 <= 0.
  • V2 .. V6: RMS amplitudes of the second through sixth harmonics in the same unit as V1.
  • harmonicRms: Square root of the sum of squared harmonic amplitudes; the THD_F numerator.
  • THD_F: Fundamental-referenced distortion factor (as a fraction, multiplied by 100 in the result panel).
  • THD_R: RMS-referenced factor, equal to THD_F / sqrt(1 + THD_F^2). Never exceeds 100 %.
  • a_k: Distortion attenuation in dB, equal to 20 log10(THD_F). Clamped to -120 dB when THD_F = 0.
  • k: Distortion factor as a percentage. Forward: a_k = 20 log10(k / 100); inverse: k = 10^(a_k/20) * 100.

The forward and inverse branches use the same 20 log10(k / 100) identity that audio analyzer front panels implement in firmware, so this total harmonic distortion calculator reads back exactly the numbers a bench instrument would.

Closed-form references: square wave THD_F = sqrt(pi^2/8 - 1), sawtooth THD_F = sqrt(pi^2/6 - 1), triangle THD_F = sqrt(pi^4/96 - 1).

Amplifier with V1 = 1 V and a -20 dB second harmonic

V1 = 1, V2 = 0.1, V3 = 0.05, V4 = 0.02, V5 = V6 = 0

harmonic RMS = sqrt(0.0129) = 0.1136; THD_F = 11.36 %; a_k = -18.89 dB

THD_F = 11.36 %, THD_R = 11.29 %, a_k = -18.89 dB

The amplifier adds about 11 % harmonic content, or -19 dB attenuation.

Pure square wave with the first five odd harmonics

V1 = 1, V2 = 1/3, V3 = 1/5, V4 = 1/7, V5 = 1/9, V6 = 1/11

harmonic RMS = sqrt(0.1921) = 0.4383; THD_F = 43.83 %; a_k = -7.16 dB

THD_F = 43.83 %, THD_R = 40.14 %, a_k = -7.16 dB

Adding the first five odd harmonics reaches 43.8 %, converging toward the Wikipedia reference of 48.3 %.

According to Wikipedia (Total harmonic distortion), total harmonic distortion is defined as THD_F = sqrt(V2^2 + V3^2 + V4^2 + ...) / V1 and THD_R = THD_F / sqrt(1 + THD_F^2), and a pure square wave reads THD_F = 48.3 % and THD_R = 43.5 %

For broader power and voltage dB arithmetic, Decibel Calculator handles 10 log10 and 20 log10 conversions across any input and reference pair.

Key Concepts Explained

Four ideas are enough to interpret every number on the result panel.

Fundamental-referenced THD_F

THD_F divides the RMS sum of all higher harmonics by the fundamental V1. This is the percent value most audio amplifier datasheets publish, and it can exceed 100 % for heavily distorted signals (a square wave reads 48.3 %; a clipped sine reads well above 100 %).

RMS-referenced THD_R

THD_R divides the same harmonic RMS by the RMS of the full signal. It is bounded between 0 % and 100 %, equals THD_F at low distortion, and is the value used in IEC power-quality standards.

Distortion attenuation a_k = 20 log10(THD_F)

The dB row is twenty times the log10 of THD_F as a fraction. 1 % THD reads -40 dB, 10 % reads -20 dB, 0.01 % reads -80 dB. The converter panel uses the same identity in both directions.

Harmonic RMS sum sqrt(V2^2 + V3^2 + ...)

The harmonic RMS sum is the shared numerator of THD_F and THD_R. A small high-order harmonic barely moves the sum; a single large low-order harmonic dominates it (a 0.5 V second harmonic contributes 0.25 to the sum of squares).

The harmonic RMS sum is the raw ingredient; THD_F and THD_R are two normalizations of it; the dB attenuation is the logarithmic version of THD_F. The same squared-and-summed structure is what THD+N (total harmonic distortion plus noise) builds on.

For matching and reflection analysis that pairs with a low-distortion transmission line, Cable Impedance Calculator returns characteristic impedance Z0 alongside capacitance and delay for any coax or twisted-pair cross-section.

How to Use This Calculator

Five short steps cover both the harmonics-to-THD analysis and the percent / dB converter workflow.

  1. 1 Enter the fundamental RMS amplitude V1: Type V1 in volts (or the same RMS unit). The form rejects V1 = 0 or negative inputs.
  2. 2 Enter up to five harmonic amplitudes V2..V6: Use the second through sixth harmonic rows. Leave unused rows at 0; only non-zero rows contribute to the harmonic RMS sum.
  3. 3 Read THD_F, THD_R, and the dB attenuation: The top three result rows print THD percent, THD+R percent, and the dB attenuation. Compare THD_F to your amplifier datasheet spec or the IEEE Std 519-2022 limit.
  4. 4 Use the percent <-> dB converter for spec translation: Type a percent value and read the dB row, or a dB value and read the percent row.
  5. 5 Cross-check the closed-form values for square, sawtooth, and triangle: Set V1 = 1 and enter the textbook odd-harmonic series (1/3, 1/5, 1/7, 1/9, ...) for a square wave. THD_F converges toward 48.3 % as more odd harmonics are added.

To check an amplifier datasheet's 0.01 % THD spec at the bench, type V1 = 1, V2 = 0.0001, V3..V6 = 0 and read THD_F = 0.01 %, a_k = -80 dB.

The nth term of the harmonic series that drives the V_n coefficients of a square or sawtooth wave is the 1/n value Harmonic Number Calculator returns as the partial-sum H_n term index.

Benefits of Using This Calculator

The calculator replaces the manual square-root-and-divide step that a harmonic list would otherwise require.

  • Two THD definitions in one panel: Both THD_F and THD_R print side by side, so the same reading covers an audio datasheet and an IEC power-quality spec.
  • Direct percent <-> dB conversion: The bottom two rows convert k = 1 % to a_k = -40 dB and back.
  • Five harmonic slots cover the audio band: Up to five harmonic rows model the dominant harmonics in a typical audio amplifier, where the second and third harmonic usually carry 90 % of the distortion energy.
  • Domain error for zero or negative V1: If the fundamental amplitude is missing, the calculator returns a domain error instead of dividing by zero.
  • Pairs with the Decibel Calculator: For power, voltage, or current dB arithmetic, the Decibel Calculator in Math & Conversion handles 10 log10 and 20 log10 conversions with the same convention.

For the dB-to-percent conversion, the inverse branch uses the standard k = 10^(a_k/20) * 100 identity, matching the readings from audio analyzer front panels in firmware.

Once THD is in hand, the dBm, dBu, and dBV readings on the same datasheet are the unit conversions RF Unit Converter handles.

Factors That Affect Your Results

Three things decide the result, plus two caveats about how THD behaves at boundaries.

Fundamental amplitude V1

V1 sets the denominator for both THD_F and THD_R. Halving V1 doubles THD_F; doubling V1 halves it; the dB attenuation moves by 6 dB in the opposite direction.

Harmonic count and amplitude distribution

A single large low-order harmonic dominates the sum (a 0.5 V second harmonic contributes 0.25 to the sum of squares). Many small high-order harmonics contribute much less per harmonic.

Whether to reference THD_F or THD_R

Below 10 % THD_F, THD_R is within 0.5 % of THD_F. Above 50 % they diverge: a square wave reads THD_F = 48.3 %, THD_R = 43.5 %.

Percent <-> dB clamping at boundaries

At k = 0 the dB attenuation would be -infinity; the calculator clamps to -120 dB so a zero reading does not produce NaN.

  • The calculator accepts up to five harmonic amplitudes (V2..V6). Real-world signals often contain significant energy above the sixth harmonic, so the partial-sum reading underestimates the true THD.
  • THD+N (total harmonic distortion plus noise) is not the same as THD. THD+N adds a noise term before dividing by the fundamental; this calculator reads the pure harmonic THD only.

When you scale the harmonics by a constant, the harmonic RMS sum scales by the same constant, THD_F scales by it, and the dB attenuation shifts by 20 log10 of the constant. This linearity lets you scale an existing harmonic list without re-running the FFT.

According to Wikipedia (Signal-to-noise ratio), SNR_dB = 10 log10(P_signal / P_noise) for power ratios and 20 log10(A_signal / A_noise) for amplitude ratios, and SINAD is the reciprocal of THD+N over the same bandwidth.

According to Omni Calculator (Total Harmonic Distortion), distortion attenuation a_k in decibels is given by a_k = 20 log10(k/100) with k as a percentage, and the inverse is k = 10^(a_k/20) * 100.

The propagation delay and rise-time numbers that drive the THD+N of a long cable sit alongside the bit-rate and frame analysis the Baud Rate Calculator returns.

total harmonic distortion calculator showing the THD percent, THD+R percent, distortion attenuation in dB, and the harmonic RMS sum from a list of V1..Vn amplitudes
total harmonic distortion calculator showing the THD percent, THD+R percent, distortion attenuation in dB, and the harmonic RMS sum from a list of V1..Vn amplitudes

Frequently Asked Questions

Q: What is total harmonic distortion (THD)?

A: THD is a single-number summary of the harmonic content a non-linear device adds to a clean sine wave. THD_F divides the RMS sum of harmonic amplitudes (V2, V3, V4, ...) by the fundamental V1, so a 1 V fundamental with 0.1 V of harmonics reads THD_F = 10 %.

Q: How do you calculate THD from harmonic amplitudes?

A: Square each harmonic amplitude, sum those squares, take the square root to get the harmonic RMS, and divide by V1. With V1 = 1, V2 = 0.1, V3 = 0.05, V4 = 0.02 and V5 = V6 = 0, the harmonic RMS is 0.1136 and THD_F = 11.36 % or -18.89 dB attenuation.

Q: What is the difference between THDF and THDR?

A: THD_F divides the harmonic RMS by V1 only; THD_R divides the same harmonic RMS by the full-signal RMS. At low distortion the two are nearly equal; at high distortion THD_F can exceed 100 % while THD_R never does. A square wave reads THD_F = 48.3 %, THD_R = 43.5 %.

Q: What is a good THD value for audio equipment?

A: Consumer audio gear is typically below 1 % THD (-40 dB or lower); budget amplifiers sit at 0.1 % (-60 dB), and reference-grade amplifiers reach 0.001 % (-100 dB) or better.

Q: How do you convert distortion factor to decibels?

A: Distortion attenuation in decibels is a_k = 20 log10(k / 100) with k as a percentage. k = 1 % gives a_k = -40 dB; k = 10 % gives a_k = -20 dB; k = 0.01 % gives a_k = -80 dB. The inverse is k = 10^(a_k/20) x 100.

Q: What is THD plus noise and when is it used?

A: THD+N adds a noise term to the harmonic RMS sum before dividing by the fundamental. It captures hum, RF interference, and quantisation noise alongside harmonic distortion and is reciprocal to SINAD over the same bandwidth. This calculator returns the pure harmonic THD only.