By · Updated

Sparkline Generator

Tiny SVG Line, Area or Bar Chart to Embed, Free

No ratings yet

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Sparkline Generator works

This sparkline generator makes word-sized charts. A sparkline is a word-sized chart: a line, area or row of bars a few pixels tall that sits in a table cell, next to a number on a dashboard or inline in a sentence, showing the shape of a trend without axes or labels. Paste a list of numbers, set the width and height in pixels, choose the type and markers, and copy or download an SVG small enough to embed anywhere. Nothing is uploaded.

Sparkline generator: entering the numbers

Type or paste the values in order, separated by commas, spaces or new lines; a column copied from a spreadsheet works as it is. Percent and currency signs are stripped. Two values is the minimum, and the sparkline stays sharp for a few hundred because the SVG scales to the width you set rather than one pixel per point.

Types

Line joins the points with straight segments; Smooth line rounds the corners with a monotone curve that never overshoots. Area fills under the line at low opacity, which reads better on a busy page. Bars draws one column per value from zero, so negatives hang below the baseline. Win/loss ignores the size of each value and draws an up tick for positive and a down tick for negative, the classic form for a sequence of results or daily gains and losses.

Size and markers

Width and height are the pixel size of the SVG itself, so 120 by 30 gives a file that drops into a table row at its natural size. The preview is scaled up so you can see the shape; the downloaded file is the true size. Markers add a dot on the last point, on the minimum and maximum, or all three, in the palette colours. Line width is in pixels at the true size.

Embedding

Copy SVG puts the markup on the clipboard; paste it straight into an HTML page, a Markdown file that allows inline SVG, or a component. Because there is no text inside, it needs no fonts and scales cleanly. Choose the Transparent background so the sparkline takes the colour of whatever sits behind it, or White when it will be placed on a photograph or dark panel. Download PNG renders it at one, two or three times the set size for email clients and documents that do not accept SVG.

Stats

The panel gives the count, minimum, maximum, last value, the change from first to last and the pixel size of the file, which is what you would print alongside the sparkline in a table: the chart shows the shape, the number gives the scale.

FAQ

Why is there no axis or scale?

That is the point of a sparkline. It shows the shape of a series in the space of a word, and the number printed beside it supplies the scale. The tooltip on the SVG carries the range and last value for anyone who hovers.

Does the vertical scale start at zero?

For Line, Smooth line and Area it runs from the minimum to the maximum so the shape fills the height. Bars always include zero, since a bar with no baseline is meaningless. Win/loss has no scale at all, only sign.

Can I make a sparkline for a table with many rows?

Paste one row's values at a time and copy each SVG. Since the size and type stay set between pastes, generating a dozen matching sparklines takes only a few seconds each.

What is the chart title box for?

Nothing on this page; a sparkline has no room for a title. The box is shared with the larger chart makers on the site and can be left empty.

See also: all Chart Makers tools, Images, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.

Related tools