Free to use, no account

Histogramkalkulator

Lim inn opptil 5 000 tall for å lage et histogram med like intervaller. Velg en automatisk intervallregel eller angi antall intervaller, og vis eller eksporter deretter frekvensene.

Skill verdiene med mellomrom, semikolon eller linjeskift. Semikolon bevarer desimalkomma.

Støtter 1–5,000 endelige verdier med absoluttverdi på maksimalt 10⁹ og 1–50 intervaller med lik bredde. Det siste intervallet inkluderer høyre endepunkt. Relativ frekvens og tetthet normaliseres etter alle oppgitte verdier. Hvis Freedman–Diaconis ikke kan bruke en positiv IQR eller et positivt dataområde, brukes Sturges i stedet. Dette er et beskrivende diagram, ikke en statistisk slutning eller sannsynlighetsmodell.

Hvordan lager jeg et histogram?

Skriv inn numeriske data og velg en regel for intervallene. Kalkulatoren deler dataområdet i intervaller med lik bredde, teller hver verdi én gang og inkluderer maksimumsverdien i det siste intervallet.

Veiledning

Slik bruker du histogram-calculator

The Histogram Calculator sorts a list of numbers into equal-width bins and shows the result as a bar chart and a frequency table. You choose a rule for the number of bins, or type your own. It describes the numbers you entered. It does not run a statistical test, fit a curve or tell you what the data means.

Slik gjør du

  1. Paste or type between 1 and 5,000 numbers in the data box. Separate them with spaces, semicolons, vertical bars or new lines.
  2. Pick a bin rule: Sturges, square-root, Freedman–Diaconis, or set your own count from 1 to 50. Then choose whether bars show counts, percent or density.
  3. Press Build histogram, read the table under the chart, and copy it or download the table as a CSV file or the chart as an SVG file.

Eksempler

The built-in example

Du skriver inn
Data
1; 2; 2; 3; 4
Regel
Set bin count
Intervaller
2
Stolpehøyde
Frequency count
Du får
Intervallbredde
1.5
Tabell
Intervall: 1 to 2.5 (upper end not included); Antall: 3; Prosent: 60; Tetthet: 0.4; Kumulativt: 3; Intervall: 2.5 to 4 (upper end included); Antall: 2; Prosent: 40; Tetthet: 0.266667; Kumulativt: 5

The range 1 to 4 is cut into two pieces, each 1.5 wide. The values 1, 2 and 2 fall in the first piece; 3 and 4 fall in the second, which keeps its upper end so 4 is not lost. Density is the share divided by the width: 0.6 divided by 1.5 is 0.4.

Kjørt med verktøyets egen kode.

Ten values with the Sturges rule

Du skriver inn
Data
1; 2; 2; 3; 4; 5; 7; 8; 8; 10
Regel
Sturges rule
Du får
Intervaller
5
Intervallbredde
1.8
Grenser
1; 2.8; 4.6; 6.4; 8.2; 10
Antall
3; 2; 1; 3; 1

Sturges takes 1 plus the base-2 logarithm of 10 and rounds up to the next whole number, which is 5. The range is 9, and 9 divided by 5 is 1.8. The five counts add up to the ten values.

Kjørt med verktøyets egen kode.

Freedman–Diaconis with no spread

Du skriver inn
Data
3 3 3 3 9
Regel
Freedman–Diaconis rule
Du får
Brukte intervaller
4
Intervallbredde
1.5
Antall
4; 0; 0; 1
Merknad
The interquartile range or data range is zero, so the Sturges rule was used instead.

Both quartiles are 3, so the middle half of the data has no spread and this rule cannot size a bin. The tool falls back to Sturges, which gives 4 bins, and prints a note to say so.

Kjørt med verktøyets egen kode.

Every value the same

Du skriver inn
Data
5 5 5
Regel
Sturges rule
Du får
Intervaller
3
Visningsområde
4.5 to 5.5
Antall
0; 3; 0
Merknad
All values are equal; the display range was expanded so the chart remains visible.

With no spread the chart would be a single line, so the tool widens the range by 1 (or by 1% of the value when that is larger). All three values land in the middle bin.

Kjørt med verktøyets egen kode.

A value the tool cannot read

Du skriver inn
Data
1e3 5 7
Du får
Melding
Check the data and histogram settings.

Scientific notation is not accepted, so 1e3 is read as not-a-number and the whole run is refused. Writing 1000 instead makes the same data work.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Look at how test scores, survey ratings or ages are spread before choosing an average to quote.
  • Make a quick chart of delivery times, prices or sensor readings for a report, a slide or a class handout.
  • Compare how three bin rules change the picture of the same list, then keep the one that reads best.

Begrensninger

  • Takes 1 to 5,000 finite numbers no larger than 1,000,000,000 in size, and 1 to 50 bins. Scientific notation such as 1e3 is refused, and one unreadable value stops the whole run.
  • All bins have the same width. Only the last bin includes its upper end. The page calls the result a descriptive chart, not a statistical inference or a probability model.
  • In the English page a comma followed by exactly three digits is a thousands mark, so 1,500 is read as 1500, while 1,5 is read as 1.5. Use a decimal point to avoid doubt.

Tips

  • Try two or three bin rules on the same data. If the shape changes a lot, say which rule you used when you share the chart.
  • Use the density view to compare samples of different sizes, because the total bar area is one.
  • If your numbers use decimal commas, separate them with semicolons, as the hint under the data box suggests.

Vanlige spørsmål

How many bins should I use?

There is no single right answer. Sturges is a simple start for small samples, the square-root rule grows a little faster, and Freedman–Diaconis uses the spread of the middle half of the data. Try more than one and keep the clearest.

What is the difference between frequency, relative frequency and density?

Frequency counts the values in each bin. Relative frequency shows that count as a percent of all values. Density divides the relative share by the bin width, so the bar areas add up to one.

Does the last bin include its upper limit?

Yes. Every other bin includes its lower limit but not its upper limit, while the last bin keeps both ends. This way the largest value is never left out of the count.

Can I save the result?

Yes. After you build a histogram you can copy the table, download it as a CSV file, or download the chart as an SVG file. The CSV holds the bin number, bounds, frequency, percent, density and cumulative count.

Is my data uploaded anywhere?

No. The histogram is worked out in your browser, and the tool does not upload or save your values. If you want a record, download the CSV or the SVG before you leave the page.

When should I not rely on this histogram?

Be careful with very small samples, with numbers in mixed units, and with any claim about a wider group. The chart only shows the values you typed, sorted into bins, and says nothing about where they came from.

Kilder

Ofte stilte spørsmål

Hvordan lager jeg et histogram?

Skriv inn numeriske data og velg en regel for intervallene. Kalkulatoren deler dataområdet i intervaller med lik bredde, teller hver verdi én gang og inkluderer maksimumsverdien i det siste intervallet.

Lastes dataene mine opp?

Nei. Histogrammet beregnes i nettleseren. Verdiene dine lastes ikke opp eller lagres av verktøyet.

Hvilken intervallregel bør jeg bruke?

Sturges er et enkelt utgangspunkt for mindre utvalg. Kvadratrotregelen bruker kvadratroten av utvalgsstørrelsen. Freedman–Diaconis bruker kvartilbredden og kan tilpasse seg spredning og uteliggere. Du kan også velge antall intervaller selv.

Hva er forskjellen på frekvens og tetthet?

Frekvens teller verdier i hvert intervall. Relativ frekvens viser prosentandelen. Sannsynlighetstetthet deler relativ frekvens på intervallbredden, slik at det samlede søylearealet blir én.

Inkluderer det siste intervallet den øvre grensen?

Ja. Intervallene er halvåpne, bortsett fra det siste, som inkluderer den høyeste dataverdien slik at ingen verdier utelates.