# barcode icon

Barcode. Gentleface icon, drawn on the 16 px pixel grid. Free, MIT licensed. Page: https://gentleface.com/icons/barcode

- Category: Shopping
- Use it for: barcode, product code, sku, upc, ean
- Tags: barcode, scan, product, sku, upc, ean, inventory, price
- Component name: BarcodeIcon
- Added: 2026-10-14

## Alternatives

- `qr-code`: a 2D code that carries a link, ticket or payment
- `scan-barcode`: the scan action (scanner frame around the bars)

## Also fits

- qr code: a 1D product code (SKU, EAN)
- scan barcode: show the barcode of a product (barcode)

## Files

Each SVG is 16 × 16 with fill="currentColor". Keep it at 16 px or an exact multiple (32, 48) on whole pixels: a fractional size or position blurs it.

- line-round: https://gentleface.com/svg/line-round/16/barcode.svg · PNG https://gentleface.com/png/line-round/16/barcode.png · https://gentleface.com/png/line-round/32/barcode.png · https://gentleface.com/png/line-round/48/barcode.png
- line-soft: https://gentleface.com/svg/line-soft/16/barcode.svg · PNG https://gentleface.com/png/line-soft/16/barcode.png · https://gentleface.com/png/line-soft/32/barcode.png · https://gentleface.com/png/line-soft/48/barcode.png
- line-sharp: https://gentleface.com/svg/line-sharp/16/barcode.svg · PNG https://gentleface.com/png/line-sharp/16/barcode.png · https://gentleface.com/png/line-sharp/32/barcode.png · https://gentleface.com/png/line-sharp/48/barcode.png
- solid-round: https://gentleface.com/svg/solid-round/16/barcode.svg · PNG https://gentleface.com/png/solid-round/16/barcode.png · https://gentleface.com/png/solid-round/32/barcode.png · https://gentleface.com/png/solid-round/48/barcode.png
- solid-soft: https://gentleface.com/svg/solid-soft/16/barcode.svg · PNG https://gentleface.com/png/solid-soft/16/barcode.png · https://gentleface.com/png/solid-soft/32/barcode.png · https://gentleface.com/png/solid-soft/48/barcode.png
- solid-sharp: https://gentleface.com/svg/solid-sharp/16/barcode.svg · PNG https://gentleface.com/png/solid-sharp/16/barcode.png · https://gentleface.com/png/solid-sharp/32/barcode.png · https://gentleface.com/png/solid-sharp/48/barcode.png

The SVG of every style: https://gentleface.com/icons/barcode.json (`svg`).

## Code (line-round)

The snippets are decorative (aria-hidden). For an icon that carries meaning on its own, such as an icon-only button, label the button, or give the SVG role="img" and an aria-label. For another style, take its SVG from the JSON and swap the path `d`.

### SVG

```svg
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M3 3L3 13L2 13L2 3L3 3ZM6 3L6 13L4 13L4 3L6 3ZM8 13L7 13L7 3L8 3L8 13ZM11 3L11 13L10 13L10 3L11 3ZM14 13L12 13L12 3L14 3L14 13Z"/></svg>
```

### React

```tsx
// Gentleface "barcode" (line-round), MIT. https://gentleface.com/icons/barcode
import type { SVGProps } from 'react';

export function BarcodeIcon(props: SVGProps<SVGSVGElement>) {
  return (
    <svg xmlns="http://www.w3.org/2000/svg" width={16} height={16} viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" {...props}>
      <path d="M3 3L3 13L2 13L2 3L3 3ZM6 3L6 13L4 13L4 3L6 3ZM8 13L7 13L7 3L8 3L8 13ZM11 3L11 13L10 13L10 3L11 3ZM14 13L12 13L12 3L14 3L14 13Z" />
    </svg>
  );
}
```

### Vue

```vue
<!-- Gentleface "barcode" (line-round), MIT. https://gentleface.com/icons/barcode -->
<template>
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
    <path d="M3 3L3 13L2 13L2 3L3 3ZM6 3L6 13L4 13L4 3L6 3ZM8 13L7 13L7 3L8 3L8 13ZM11 3L11 13L10 13L10 3L11 3ZM14 13L12 13L12 3L14 3L14 13Z" />
  </svg>
</template>
```

### Svelte

```svelte
<!-- Gentleface "barcode" (line-round), MIT. https://gentleface.com/icons/barcode -->
<script>
  let props = $props();
</script>

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" {...props}>
  <path d="M3 3L3 13L2 13L2 3L3 3ZM6 3L6 13L4 13L4 3L6 3ZM8 13L7 13L7 3L8 3L8 13ZM11 3L11 13L10 13L10 3L11 3ZM14 13L12 13L12 3L14 3L14 13Z" />
</svg>
```

### HTML img

```html
<!-- Gentleface "barcode" (line-round), MIT. https://gentleface.com/icons/barcode. An <img> can't take currentColor: it draws black. Inline the SVG or use the CSS mask to color it. -->
<img src="https://gentleface.com/svg/line-round/16/barcode.svg" width="16" height="16" alt="">
```

### CSS

```css
/* Gentleface "barcode" (line-round), MIT. https://gentleface.com/icons/barcode. Takes the text color. */
.icon-barcode {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath d='M3 3L3 13L2 13L2 3L3 3ZM6 3L6 13L4 13L4 3L6 3ZM8 13L7 13L7 3L8 3L8 13ZM11 3L11 13L10 13L10 3L11 3ZM14 13L12 13L12 3L14 3L14 13Z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath d='M3 3L3 13L2 13L2 3L3 3ZM6 3L6 13L4 13L4 3L6 3ZM8 13L7 13L7 3L8 3L8 13ZM11 3L11 13L10 13L10 3L11 3ZM14 13L12 13L12 3L14 3L14 13Z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}
```

### Data URL

```text
data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath d='M3 3L3 13L2 13L2 3L3 3ZM6 3L6 13L4 13L4 3L6 3ZM8 13L7 13L7 3L8 3L8 13ZM11 3L11 13L10 13L10 3L11 3ZM14 13L12 13L12 3L14 3L14 13Z'/%3E%3C/svg%3E
```

### Sprite

```html
<!-- Gentleface "barcode" (line-round), MIT. https://gentleface.com/icons/barcode
     Every icon of this style in one file: https://gentleface.com/sprite/line-round.svg
     Serve it from your own origin: <use> does not load from another origin. -->
<svg width="16" height="16" aria-hidden="true"><use href="/sprite/line-round.svg#barcode"/></svg>
```

### SwiftUI

```swift
// Gentleface "barcode" (line-round), MIT. https://gentleface.com/icons/barcode
import SwiftUI

struct BarcodeIcon: Shape {
    func path(in rect: CGRect) -> Path {
        var p = Path()
        p.move(to: CGPoint(x: 3, y: 3))
        p.addLine(to: CGPoint(x: 3, y: 13))
        p.addLine(to: CGPoint(x: 2, y: 13))
        p.addLine(to: CGPoint(x: 2, y: 3))
        p.addLine(to: CGPoint(x: 3, y: 3))
        p.closeSubpath()
        p.move(to: CGPoint(x: 6, y: 3))
        p.addLine(to: CGPoint(x: 6, y: 13))
        p.addLine(to: CGPoint(x: 4, y: 13))
        p.addLine(to: CGPoint(x: 4, y: 3))
        p.addLine(to: CGPoint(x: 6, y: 3))
        p.closeSubpath()
        p.move(to: CGPoint(x: 8, y: 13))
        p.addLine(to: CGPoint(x: 7, y: 13))
        p.addLine(to: CGPoint(x: 7, y: 3))
        p.addLine(to: CGPoint(x: 8, y: 3))
        p.addLine(to: CGPoint(x: 8, y: 13))
        p.closeSubpath()
        p.move(to: CGPoint(x: 11, y: 3))
        p.addLine(to: CGPoint(x: 11, y: 13))
        p.addLine(to: CGPoint(x: 10, y: 13))
        p.addLine(to: CGPoint(x: 10, y: 3))
        p.addLine(to: CGPoint(x: 11, y: 3))
        p.closeSubpath()
        p.move(to: CGPoint(x: 14, y: 13))
        p.addLine(to: CGPoint(x: 12, y: 13))
        p.addLine(to: CGPoint(x: 12, y: 3))
        p.addLine(to: CGPoint(x: 14, y: 3))
        p.addLine(to: CGPoint(x: 14, y: 13))
        p.closeSubpath()
        return p.applying(CGAffineTransform(scaleX: rect.width / 16, y: rect.height / 16))
    }
}

// BarcodeIcon().frame(width: 16, height: 16) fills with the foreground style. Keep it on whole points to stay crisp.
```

### Compose

```kotlin
// Gentleface "barcode" (line-round), MIT. https://gentleface.com/icons/barcode
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.addPathNodes
import androidx.compose.ui.unit.dp

val BarcodeIcon: ImageVector by lazy {
    ImageVector.Builder(
        name = "barcode", defaultWidth = 16.dp, defaultHeight = 16.dp,
        viewportWidth = 16f, viewportHeight = 16f,
    ).addPath(
        pathData = addPathNodes("M3 3L3 13L2 13L2 3L3 3ZM6 3L6 13L4 13L4 3L6 3ZM8 13L7 13L7 3L8 3L8 13ZM11 3L11 13L10 13L10 3L11 3ZM14 13L12 13L12 3L14 3L14 13Z"),
        fill = SolidColor(Color.Black),
    ).build()
}

// Icon(BarcodeIcon, contentDescription = null) tints it with LocalContentColor.
```

### Android XML

```xml
<!-- res/drawable/ic_barcode.xml · Gentleface "barcode" (line-round), MIT. https://gentleface.com/icons/barcode -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="16dp"
    android:height="16dp"
    android:viewportWidth="16"
    android:viewportHeight="16"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M3 3L3 13L2 13L2 3L3 3ZM6 3L6 13L4 13L4 3L6 3ZM8 13L7 13L7 3L8 3L8 13ZM11 3L11 13L10 13L10 3L11 3ZM14 13L12 13L12 3L14 3L14 13Z"/>
</vector>
```

### Flutter

```dart
// Gentleface "barcode" (line-round), MIT. https://gentleface.com/icons/barcode
import 'package:flutter/widgets.dart';

class BarcodeIcon extends StatelessWidget {
  const BarcodeIcon({super.key, this.size = 16, this.color});
  final double size;
  final Color? color;

  @override
  Widget build(BuildContext context) => CustomPaint(
        size: Size.square(size),
        painter: _BarcodeIconPainter(color ?? IconTheme.of(context).color ?? const Color(0xFF000000)),
      );
}

class _BarcodeIconPainter extends CustomPainter {
  _BarcodeIconPainter(this.color);
  final Color color;

  @override
  void paint(Canvas canvas, Size size) {
    canvas.scale(size.width / 16, size.height / 16);
    final p = Path()
      ..moveTo(3, 3)
      ..lineTo(3, 13)
      ..lineTo(2, 13)
      ..lineTo(2, 3)
      ..lineTo(3, 3)
      ..close()
      ..moveTo(6, 3)
      ..lineTo(6, 13)
      ..lineTo(4, 13)
      ..lineTo(4, 3)
      ..lineTo(6, 3)
      ..close()
      ..moveTo(8, 13)
      ..lineTo(7, 13)
      ..lineTo(7, 3)
      ..lineTo(8, 3)
      ..lineTo(8, 13)
      ..close()
      ..moveTo(11, 3)
      ..lineTo(11, 13)
      ..lineTo(10, 13)
      ..lineTo(10, 3)
      ..lineTo(11, 3)
      ..close()
      ..moveTo(14, 13)
      ..lineTo(12, 13)
      ..lineTo(12, 3)
      ..lineTo(14, 3)
      ..lineTo(14, 13)
      ..close();
    canvas.drawPath(p, Paint()..color = color);
  }

  @override
  bool shouldRepaint(_BarcodeIconPainter old) => old.color != color;
}
```
