Skip to content

Histogram maker from CSV

A histogram of any CSV column, in your browser. Nothing is uploaded.

Open a CSV to see its histogram

Drop it here or choose a file. The first number column opens as a histogram.

The sample: a year of made-up hourly weather in Leeds, 8,760 rows.

Tip: drop several files to compare them.

Your file never leaves your device. It is read and charted by your browser. Nothing is uploaded.

Opens as a histogram, with automatic bins

Column
The first number column (the one a plot shows first), every value of the whole file.
Bins
Automatic: NumPy’s “auto” rule, at most 500 bins of equal width from the smallest value to the largest.
Statistics
“Statistics” over the plot: the values counted, the number of bins and the most common range.

At a glance

Bins
Automatic, or 10, 20, 50, 100 or 200 bins of equal width, from the smallest value to the largest.
Automatic
NumPy’s “auto” rule: the narrower of the Freedman–Diaconis and Sturges bin widths, at most 500 bins.
Edges
Each bin holds its lower edge; the last one holds its upper edge too, as NumPy counts them.
Counts
How many values fall in each bin. As a table, each bin’s From, To and Count, downloadable as a CSV.
Values
Every value of the column, the whole file; missing ones are left out and counted.
Other rules
Freedman–Diaconis, Sturges or square-root bins as a table, from the Math dialog.
Accuracy
Bins and counts as numpy.histogram gives them, checked by our own tests.
Processing
Calculated in your browser. Your file is never uploaded.
Price
Free. No account or sign-up.

How to make a histogram from a CSV file

  1. Open your file. Choose a CSV, TSV, TXT, Excel, JSON, MATLAB, Parquet, HDF5 or LabVIEW TDMS file, or drop it on the tool at the top of this page. No file to hand? Click “Try a sample weather file”.
  2. See the histogram. The first number column opens as a histogram, with automatic bins. For another column, untick it in the list on the left and tick the one you want: the histogram is of the plot’s first column.
  3. Choose the bins. Open Plot settings (the sliders button in the plot’s header), then Axes, and pick Automatic or 10, 20, 50, 100 or 200 bins. “Show as a table” in the plot’s menu lists every bin, and downloads them as a CSV.

A worked example you can check

“Try a sample weather file” opens a made-up year of hourly weather in Leeds, 8,760 rows. Its first column, Leeds_Temperature, opens as a histogram of all 8,760 temperatures, from -3.33 to 21.88 °C. Click Statistics over the plot, then set 20 bins in Plot settings, and this is what you should get:

What the statistics panel shows
BinsBin widthMost common
Automatic: 340.7415 °C502 hours, 11.5–12.24 °C
Set to 201.2605 °C814 hours, 11.8–13.06 °C

The automatic rule gives 34 narrow bins for 8,760 values. Both show the same broad shape, highest around 12 °C with a long tail of cold winter hours; 20 wider bins smooth it, and the most common range moves with the edges.

The same in Python

With the sample file downloaded, these lines give NumPy’s answer for the same bins:

import numpy as np, pandas as pd

t = pd.read_csv("megarows-sample-leeds-hourly-weather.csv", skiprows=[1])["Leeds_Temperature"].to_numpy()
for bins in ["auto", 20]:
    counts, edges = np.histogram(t, bins=bins)
    k = counts.argmax()
    print(f"{bins}: {len(counts)} bins of {edges[1] - edges[0]:.4f} °C, "
          f"most common {edges[k]:.2f} to {edges[k + 1]:.2f} °C ({counts[k]} hours)")

They print:

auto: 34 bins of 0.7415 °C, most common 11.50 to 12.24 °C (502 hours)
20: 20 bins of 1.2605 °C, most common 11.80 to 13.06 °C (814 hours)

We ran them on 9 October 2026 with numpy 2.1.3, pandas 2.2.3, Python 3.12.15. A test works out the histogram on every change to the site and checks that every edge and count is NumPy’s, and that the panel’s numbers are the ones on this page. Download the sample file (CSV, 299 KB).

How the bins are chosen

Every bin has the same width, and together they run from the smallest value of the column to the largest. A value on the edge between two bins counts in the upper one; the largest value counts in the last bin. These are NumPy’s rules (numpy.histogram), so the counts match a histogram made in Python.

  • Automatic (the default) uses NumPy’s “auto” rule: it works out the Freedman–Diaconis width (twice the interquartile range divided by the cube root of the count, robust to outliers) and the Sturges width (the range divided by log₂ n + 1, good for small samples), and takes the narrower. At most 500 bins are drawn (a rule that asks for more gets 500), and if a few extreme values make it ask for more than ten million, the histogram uses 100 bins instead.
  • 10, 20, 50, 100 or 200 bins, from Plot settings, Axes, Bins, split the same range into that many equal parts.

For Freedman–Diaconis, Sturges or square-root bins on their own, use Bins by a rule over the plot: the Math dialog’s Histogram gives the bins as a table with the rule you pick.

Counts, the table and the statistics

The height of each bar is the number of values in that bin. Show as a table in the plot’s menu lists every bin with its From, To and Count, and its Download CSV saves exactly those rows. The statistics panel shows the values counted, the number of bins, the most common range and, when there are any, the rows with no value, which are left out.

The histogram always covers the whole file, whatever the zoom. It shows counts, not percentages or a density: to compare two files of different lengths, divide by the values counted.

Checked against NumPy

The same edges and counts as numpy.histogram. Our own tests compare every edge and count with NumPy’s, with each bin rule, on a test signal and on the worked example above. See every check.

Private by design: nothing is uploaded

This tool reads your file and counts the values in your browser, so the file and its name never leave your device. Files with millions of rows work: every value is counted, and the practical limit is your device’s memory.

Next steps with your data

Frequently asked questions

How do I make a histogram from a CSV file?

Open the file in the tool at the top of this page. Its first number column opens as a histogram straight away. To change the column, untick it in the list on the left and tick another; to change the bins, open Plot settings, then Axes.

How many bins does it use?

By default it picks them for you with NumPy’s “auto” rule: the narrower of the Freedman–Diaconis and Sturges bin widths, which suits both small and large files, at most 500 bins. You can also choose 10, 20, 50, 100 or 200 bins of equal width.

Can I set my own bin edges or a bin width?

Not on the histogram itself: its bins are equal-width, between the smallest and the largest value, by the automatic rule or one of the five counts. On a bar chart, “Summarise” in Plot settings can count the rows in bands of a width you choose instead.

Does it show counts or percentages?

Counts: how many values fall in each bin. The statistics panel gives the total counted, so a bin’s share is its count divided by that total. There is no density or percentage scale yet.

What about Sturges or square-root bins?

The Math dialog’s Histogram (“Bins by a rule” over the plot) gives the bins as a table with the rule you pick: automatic, Freedman–Diaconis, Sturges, square root, or 10, 20, 50 or 100 bins. It is a table of From, To and Count, not a chart.

Is my file uploaded?

No. The file is read and the histogram is calculated by your browser, on your own device. Neither the file nor its name is sent anywhere; you can check it in the Network tab of your browser’s developer tools.

Coming soon to MegaRows: CSV to Excel and PDF reports · Compare CSV versions.

MegaRows processes files locally in your browser. Nothing is uploaded, not even the file name.