The Fast Fourier Transform (FFT) is an efficient algorithm for computing the Discrete Fourier Transform (DFT) of a finite sequence. The DFT converts data from the time (or spatial) domain into the frequency domain, revealing which sinusoidal components are present and how strong they are.
A direct DFT for a sequence of length N requires on the order of N2 operations. The FFT reduces this to roughly N log2 N operations by reusing intermediate results. For practical purposes, this means that even quite long signals can be transformed very quickly.
Suppose you have a sequence of samples
The DFT produces complex coefficients
defined by
This formula is what the FFT computes, but it does so using a much faster algorithm, especially when N is a power of two.
This calculator uses a radix-2 Cooley–Tukey FFT. It assumes the length of your input sequence is a power of two (for example 4, 8, 16, 32, 64, and so on). Internally, the algorithm repeatedly splits the sequence into its even and odd indices, computes smaller FFTs, and then combines those partial results using complex exponentials (often called twiddle factors).
At a high level:
x[0], x[1], …, x[N-1] is reordered into even and odd positions.exp(-2πi k / N).X[0], …, X[N-1] that represents the frequency content of the original data.The complexity grows roughly as N log2 N, so doubling the length does not double the work; instead it increases it by a relatively modest factor.
The form above lets you paste or type a finite sequence of samples and compute the FFT:
0, 1, 0, -1 or 1 0 1 0.0.5 or -3) or complex numbers in a+bi form, such as 1+2i or -0.5-0.75i, as recognized by common math libraries.X[k] for each integer frequency bin k.You can experiment with simple patterns (like pure tones, impulses, or step changes) and see how the output changes.
The FFT output values X[k] are complex numbers. Each one encodes both a magnitude and a phase:
|X[k]| tells you how strong the component at that frequency is.arg(X[k]) (or angle) tells you the phase offset of that component relative to the start of the sequence.Given a complex FFT coefficient X[k] = a + bi, you can compute magnitude and phase as:
Here atan2(b, a) is the two-argument arctangent that returns an angle in radians, correctly handling all quadrants.
To relate bin index k to real-world frequency, you need the sampling rate fs (samples per second) of your original data. The calculator itself operates on sample indices and does not assume any particular sampling rate, but if your data comes from a physical measurement, the approximate frequency corresponding to bin k is
for k = 0, 1, …, N-1. In many practical applications, we are mainly interested in k from 0 up to N/2, because the rest of the spectrum is redundant for real-valued signals.
Consider the simple four-sample sequence
x = [0, 1, 0, -1]
Assume one sample per unit time (the exact sampling rate does not matter for the structure of the FFT). This sequence roughly corresponds to a discrete-time sine wave at half the sampling rate.
The four-point FFT yields:
X[0] = 0X[1] = 0X[2] = 2X[3] = 0Interpretation:
X[0] is the DC component (average value). It is zero, which matches the fact that the sequence is symmetric around zero.X[2] is nonzero and purely real, indicating a strong component at frequency bin k = 2, which corresponds to half the sampling rate for N = 4.You can enter 0, 1, 0, -1 into the calculator to reproduce this result.
As a more practical example, imagine sixteeen samples from a signal that is approximately a pure tone at one frequency plus some small noise. A simplified, normalized sequence might look like:
0.0, 0.7, 1.0, 0.7, 0.0, -0.7, -1.0, -0.7, 0.0, 0.65, 0.95, 0.75, 0.05, -0.65, -0.95, -0.75
If you paste a sequence of this form into the calculator and compute the FFT, the magnitude spectrum will show one or two bins that are clearly larger than the rest. Those correspond to the primary tone. The other bins will be smaller, representing the added noise or small deviations from a perfect sine wave.
In practice, engineers often look at the magnitude of the FFT (sometimes in decibels) to identify peaks that correspond to dominant frequencies in audio, vibration, power signals, and many other domains.
The terms DFT and FFT are closely related but not identical. The table below summarizes the main differences and relationships.
| Concept | What it is | Computational cost | How it relates to this calculator |
|---|---|---|---|
| DFT (Discrete Fourier Transform) | The mathematical transform that maps a finite sequence of samples to complex frequency coefficients. | Naive implementation needs on the order of N2 operations for length N. | This calculator effectively computes the DFT values X[k] for your sequence. |
| FFT (Fast Fourier Transform) | An algorithm family (such as Cooley–Tukey) for computing the DFT much more efficiently. | Typical radix-2 FFT requires about N log2 N operations, especially when N is a power of two. | The implementation behind the calculator uses an FFT to quickly produce DFT results, especially for power-of-two lengths. |
| Inverse FFT (IFFT) | The algorithm that reconstructs the time-domain sequence from its complex frequency coefficients. | Similar cost to the forward FFT: about N log2 N. | This page focuses on the forward FFT only. To get back to the time domain, you would need an inverse FFT tool or function. |
The raw FFT output is complex. To get magnitude, compute sqrt(real^2 + imag^2) for each bin. To get phase, compute an angle with atan2(imag, real). Many plotting tools use these formulas behind the scenes.
If your data was sampled at fs samples per second and the FFT length is N, then frequency bin k corresponds to f[k] = k × fs / N hertz. For example, with fs = 1 kHz and N = 1024, bin k = 100 is approximately 97.7 Hz.
The calculator outputs complex FFT values. To approximate a power spectrum, you can compute |X[k]|^2 for each bin and optionally normalize or scale according to your application. This is often used in vibration analysis, audio power measurements, and similar settings.
To keep the calculator straightforward and efficient, several assumptions and limitations apply:
You can use the FFT calculator to explore and prototype many real-world problems, for example:
The FFT is often used together with other operations such as inverse FFT, convolution, and filtering. If your workflow involves moving between time and frequency domains, you may also be interested in tools for inverse transforms, discrete-time convolution, simple digital filters, and window function generation. Linking these tools in your own analysis pipeline can make frequency-domain exploration faster and more reliable.