Format Code Now
/

Bar Graph Maker

FV-49

Paste a table with a header row and the bar graph draws itself. Switch between side by side and stacked bars, vertical or horizontal, then download it as SVG or PNG.

Runs in your browser. Nothing is uploaded.

Data (CSV or tab)

Bar graph

Quarterly results: bar chart of Revenue, Costs, Profit for 4 categories.

How to use it

  1. Paste your data: category names in the first column, one column of numbers per series, headers in the first row.
  2. Add a chart title and axis titles if you want them.
  3. Choose vertical or horizontal bars, side by side or stacked, and turn on value labels if the numbers should show.
  4. Press Download PNG for slides and documents, or Download SVG or Copy SVG for the web.

What the data should look like

Copy cells straight from Excel, Google Sheets or Numbers and paste them: tab-separated data works, and so does comma, semicolon or pipe separated CSV. The first row names the columns. The first column holds the category for each bar group, such as Q1, Q2 or a product name. Every other column is one series and gets its own color in the legend. Numbers can use a thousands comma inside quotes ("1,250") or a trailing percent sign; anything else that is not a number stops the graph and the message names the row and column.

Grouped, stacked and negative values

Side by side puts each series next to the others inside a category, which is the clearer choice for comparing series. Stacked piles them into one bar, which shows the total per category. The value axis always starts at zero, because a bar's length is its value. Negative numbers hang below the zero line; in stacked mode positive values stack upward and negative values stack downward from zero, so a loss never hides inside a total.

Colors people can tell apart

The default palette is the Okabe-Ito set of eight colors, chosen so the series stay distinct for the common kinds of color blindness. A second color-blind safe palette from Paul Tol and a grays option are in the Palette menu, or type your own hex colors in Custom colors. Numbers written inside a colored bar are black or white, whichever contrasts more with that color.

Error messages and what to do

MessageWhat it meansFix
Row 4, column "Costs" is empty. Fill in a number or remove the row.A value cell is blank. Bars need a number in every cell.Type the number, use 0 if that is what it means, or delete the row.
Row 3, column "Revenue": "n/a" is not a number.That cell holds text the graph cannot read as a number.Replace it with a plain number such as 120 or 1250.5.
Row 5 has 4 values but the header row has 3 columns.A row has more cells than there are headers, often an unquoted comma inside a name.Add a header for the extra column, or wrap text that contains commas in double quotes.

Questions people ask

How do I make a bar graph from Excel data?

Select the cells in Excel including the header row, copy them and paste into the data box. Excel copies cells as tab-separated text, which this tool reads directly. The first column becomes the categories and each further column becomes a colored series.

What is the difference between a grouped and a stacked bar graph?

A grouped bar graph puts one bar per series side by side, so you can compare series inside each category. A stacked bar graph puts the series on top of each other in one bar, so you see the category total and how it splits.

Can a bar graph show negative numbers?

Yes. The value axis always includes zero and extends below it when any value is negative, so those bars point down from the zero line. In stacked mode the negative parts stack downward and the positive parts upward.

How do I make a horizontal bar graph?

Set Bars to Horizontal. The categories move to the left side, which suits long category names such as survey answers or product titles, and the values run along the bottom axis.

Should I download the bar graph as SVG or PNG?

SVG is a vector file that stays sharp at any size and can be edited in Figma, Illustrator or a code editor, which suits web pages. PNG is a picture that works everywhere, including slides and chat apps; choose 2x or 3x for a sharp result on high resolution screens.

Is my data uploaded anywhere?

No. The graph is drawn by code running in this page, and the PNG is made by your own browser from that drawing. Your numbers stay on your device. A share link keeps the data after the # in the address, which browsers do not send to the server.

About this tool

Paste CSV or tab-separated data (for example straight from a spreadsheet) with a header row first. The first column holds the category names and each further column becomes one series of bars. The value axis always starts at zero and uses round steps of 1, 2 or 5 times a power of ten; negative values hang below the zero line, and stacked bars stack positives up and negatives down. Empty or non-number cells stop the chart with the row and column named. Value labels show the numbers as you typed them and are left out where they would not fit. Up to 500 categories and 12 series.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.