# x icon

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

- Category: Actions
- Use it for: close, dismiss, cancel
- Tags: close, times, cross
- Component name: XIcon
- Added: 2026-10-13
- Changed: 2026-10-15 (20 px drawn, 24 px drawn)

## Alternatives

- `x-circle`: a clear or cancel button that stands alone, e.g. inside a field
- `stop-circle`: stop a running process or generation

## Don't confuse with

- `trash`: the trash motif does not mean dismiss

## Also fits

- clear filter: remove one filter chip inside a filter bar
- delete: remove from a list or dismiss without deleting the data
- close menu: dismiss a menu or a dialog entirely (close)
- clean up: clear a field, a list or a selection
- clear: close or dismiss a panel or dialog
- reject: a bare × beside an accept check, e.g. in track changes
- exit: close a dialog, panel or tab

## Not for

- multiply (use `multiply`): × as a close glyph means dismiss (close); multiply is drawn at operator size
- error (use `alert-circle`): the x motif means close or dismiss, not error

## 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/x.svg · PNG https://gentleface.com/png/line-round/16/x.png · https://gentleface.com/png/line-round/32/x.png · https://gentleface.com/png/line-round/48/x.png
- line-soft: https://gentleface.com/svg/line-soft/16/x.svg · PNG https://gentleface.com/png/line-soft/16/x.png · https://gentleface.com/png/line-soft/32/x.png · https://gentleface.com/png/line-soft/48/x.png
- line-sharp: https://gentleface.com/svg/line-sharp/16/x.svg · PNG https://gentleface.com/png/line-sharp/16/x.png · https://gentleface.com/png/line-sharp/32/x.png · https://gentleface.com/png/line-sharp/48/x.png
- solid-round: https://gentleface.com/svg/solid-round/16/x.svg · PNG https://gentleface.com/png/solid-round/16/x.png · https://gentleface.com/png/solid-round/32/x.png · https://gentleface.com/png/solid-round/48/x.png
- solid-soft: https://gentleface.com/svg/solid-soft/16/x.svg · PNG https://gentleface.com/png/solid-soft/16/x.png · https://gentleface.com/png/solid-soft/32/x.png · https://gentleface.com/png/solid-soft/48/x.png
- solid-sharp: https://gentleface.com/svg/solid-sharp/16/x.svg · PNG https://gentleface.com/png/solid-sharp/16/x.png · https://gentleface.com/png/solid-sharp/32/x.png · https://gentleface.com/png/solid-sharp/48/x.png

The SVG of every style: https://gentleface.com/icons/x.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="M11.5 2.997C11.636 2.997 11.754 3.047 11.854 3.146C11.951 3.244 12 3.362 12 3.5C12 3.638 11.951 3.756 11.854 3.854L8.207 7.5L11.854 11.146C11.953 11.246 12.003 11.364 12.003 11.5C12.003 11.636 11.953 11.754 11.854 11.854C11.754 11.953 11.636 12.003 11.5 12.003C11.364 12.003 11.246 11.953 11.146 11.854L7.5 8.207L3.854 11.854C3.756 11.951 3.638 12 3.5 12C3.362 12 3.244 11.951 3.146 11.854C3.047 11.754 2.997 11.636 2.997 11.5C2.997 11.364 3.047 11.246 3.146 11.146L6.793 7.5L3.146 3.854C3.047 3.754 2.997 3.636 2.997 3.5C2.997 3.364 3.047 3.246 3.146 3.146C3.246 3.047 3.364 2.997 3.5 2.997C3.636 2.997 3.754 3.047 3.854 3.146L7.5 6.793L11.146 3.146C11.246 3.047 11.364 2.997 11.5 2.997Z"/></svg>
```

### React

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

export function XIcon(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="M11.5 2.997C11.636 2.997 11.754 3.047 11.854 3.146C11.951 3.244 12 3.362 12 3.5C12 3.638 11.951 3.756 11.854 3.854L8.207 7.5L11.854 11.146C11.953 11.246 12.003 11.364 12.003 11.5C12.003 11.636 11.953 11.754 11.854 11.854C11.754 11.953 11.636 12.003 11.5 12.003C11.364 12.003 11.246 11.953 11.146 11.854L7.5 8.207L3.854 11.854C3.756 11.951 3.638 12 3.5 12C3.362 12 3.244 11.951 3.146 11.854C3.047 11.754 2.997 11.636 2.997 11.5C2.997 11.364 3.047 11.246 3.146 11.146L6.793 7.5L3.146 3.854C3.047 3.754 2.997 3.636 2.997 3.5C2.997 3.364 3.047 3.246 3.146 3.146C3.246 3.047 3.364 2.997 3.5 2.997C3.636 2.997 3.754 3.047 3.854 3.146L7.5 6.793L11.146 3.146C11.246 3.047 11.364 2.997 11.5 2.997Z" />
    </svg>
  );
}
```

### Vue

```vue
<!-- Gentleface "x" (line-round), MIT. https://gentleface.com/icons/x -->
<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="M11.5 2.997C11.636 2.997 11.754 3.047 11.854 3.146C11.951 3.244 12 3.362 12 3.5C12 3.638 11.951 3.756 11.854 3.854L8.207 7.5L11.854 11.146C11.953 11.246 12.003 11.364 12.003 11.5C12.003 11.636 11.953 11.754 11.854 11.854C11.754 11.953 11.636 12.003 11.5 12.003C11.364 12.003 11.246 11.953 11.146 11.854L7.5 8.207L3.854 11.854C3.756 11.951 3.638 12 3.5 12C3.362 12 3.244 11.951 3.146 11.854C3.047 11.754 2.997 11.636 2.997 11.5C2.997 11.364 3.047 11.246 3.146 11.146L6.793 7.5L3.146 3.854C3.047 3.754 2.997 3.636 2.997 3.5C2.997 3.364 3.047 3.246 3.146 3.146C3.246 3.047 3.364 2.997 3.5 2.997C3.636 2.997 3.754 3.047 3.854 3.146L7.5 6.793L11.146 3.146C11.246 3.047 11.364 2.997 11.5 2.997Z" />
  </svg>
</template>
```

### Svelte

```svelte
<!-- Gentleface "x" (line-round), MIT. https://gentleface.com/icons/x -->
<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="M11.5 2.997C11.636 2.997 11.754 3.047 11.854 3.146C11.951 3.244 12 3.362 12 3.5C12 3.638 11.951 3.756 11.854 3.854L8.207 7.5L11.854 11.146C11.953 11.246 12.003 11.364 12.003 11.5C12.003 11.636 11.953 11.754 11.854 11.854C11.754 11.953 11.636 12.003 11.5 12.003C11.364 12.003 11.246 11.953 11.146 11.854L7.5 8.207L3.854 11.854C3.756 11.951 3.638 12 3.5 12C3.362 12 3.244 11.951 3.146 11.854C3.047 11.754 2.997 11.636 2.997 11.5C2.997 11.364 3.047 11.246 3.146 11.146L6.793 7.5L3.146 3.854C3.047 3.754 2.997 3.636 2.997 3.5C2.997 3.364 3.047 3.246 3.146 3.146C3.246 3.047 3.364 2.997 3.5 2.997C3.636 2.997 3.754 3.047 3.854 3.146L7.5 6.793L11.146 3.146C11.246 3.047 11.364 2.997 11.5 2.997Z" />
</svg>
```

### HTML img

```html
<!-- Gentleface "x" (line-round), MIT. https://gentleface.com/icons/x. 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/x.svg" width="16" height="16" alt="">
```

### CSS

```css
/* Gentleface "x" (line-round), MIT. https://gentleface.com/icons/x. Takes the text color. */
.icon-x {
  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='M11.5 2.997C11.636 2.997 11.754 3.047 11.854 3.146C11.951 3.244 12 3.362 12 3.5C12 3.638 11.951 3.756 11.854 3.854L8.207 7.5L11.854 11.146C11.953 11.246 12.003 11.364 12.003 11.5C12.003 11.636 11.953 11.754 11.854 11.854C11.754 11.953 11.636 12.003 11.5 12.003C11.364 12.003 11.246 11.953 11.146 11.854L7.5 8.207L3.854 11.854C3.756 11.951 3.638 12 3.5 12C3.362 12 3.244 11.951 3.146 11.854C3.047 11.754 2.997 11.636 2.997 11.5C2.997 11.364 3.047 11.246 3.146 11.146L6.793 7.5L3.146 3.854C3.047 3.754 2.997 3.636 2.997 3.5C2.997 3.364 3.047 3.246 3.146 3.146C3.246 3.047 3.364 2.997 3.5 2.997C3.636 2.997 3.754 3.047 3.854 3.146L7.5 6.793L11.146 3.146C11.246 3.047 11.364 2.997 11.5 2.997Z'/%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='M11.5 2.997C11.636 2.997 11.754 3.047 11.854 3.146C11.951 3.244 12 3.362 12 3.5C12 3.638 11.951 3.756 11.854 3.854L8.207 7.5L11.854 11.146C11.953 11.246 12.003 11.364 12.003 11.5C12.003 11.636 11.953 11.754 11.854 11.854C11.754 11.953 11.636 12.003 11.5 12.003C11.364 12.003 11.246 11.953 11.146 11.854L7.5 8.207L3.854 11.854C3.756 11.951 3.638 12 3.5 12C3.362 12 3.244 11.951 3.146 11.854C3.047 11.754 2.997 11.636 2.997 11.5C2.997 11.364 3.047 11.246 3.146 11.146L6.793 7.5L3.146 3.854C3.047 3.754 2.997 3.636 2.997 3.5C2.997 3.364 3.047 3.246 3.146 3.146C3.246 3.047 3.364 2.997 3.5 2.997C3.636 2.997 3.754 3.047 3.854 3.146L7.5 6.793L11.146 3.146C11.246 3.047 11.364 2.997 11.5 2.997Z'/%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='M11.5 2.997C11.636 2.997 11.754 3.047 11.854 3.146C11.951 3.244 12 3.362 12 3.5C12 3.638 11.951 3.756 11.854 3.854L8.207 7.5L11.854 11.146C11.953 11.246 12.003 11.364 12.003 11.5C12.003 11.636 11.953 11.754 11.854 11.854C11.754 11.953 11.636 12.003 11.5 12.003C11.364 12.003 11.246 11.953 11.146 11.854L7.5 8.207L3.854 11.854C3.756 11.951 3.638 12 3.5 12C3.362 12 3.244 11.951 3.146 11.854C3.047 11.754 2.997 11.636 2.997 11.5C2.997 11.364 3.047 11.246 3.146 11.146L6.793 7.5L3.146 3.854C3.047 3.754 2.997 3.636 2.997 3.5C2.997 3.364 3.047 3.246 3.146 3.146C3.246 3.047 3.364 2.997 3.5 2.997C3.636 2.997 3.754 3.047 3.854 3.146L7.5 6.793L11.146 3.146C11.246 3.047 11.364 2.997 11.5 2.997Z'/%3E%3C/svg%3E
```

### Sprite

```html
<!-- Gentleface "x" (line-round), MIT. https://gentleface.com/icons/x
     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#x"/></svg>
```

### SwiftUI

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

struct XIcon: Shape {
    func path(in rect: CGRect) -> Path {
        var p = Path()
        p.move(to: CGPoint(x: 11.5, y: 2.997))
        p.addCurve(to: CGPoint(x: 11.854, y: 3.146), control1: CGPoint(x: 11.636, y: 2.997), control2: CGPoint(x: 11.754, y: 3.047))
        p.addCurve(to: CGPoint(x: 12, y: 3.5), control1: CGPoint(x: 11.951, y: 3.244), control2: CGPoint(x: 12, y: 3.362))
        p.addCurve(to: CGPoint(x: 11.854, y: 3.854), control1: CGPoint(x: 12, y: 3.638), control2: CGPoint(x: 11.951, y: 3.756))
        p.addLine(to: CGPoint(x: 8.207, y: 7.5))
        p.addLine(to: CGPoint(x: 11.854, y: 11.146))
        p.addCurve(to: CGPoint(x: 12.003, y: 11.5), control1: CGPoint(x: 11.953, y: 11.246), control2: CGPoint(x: 12.003, y: 11.364))
        p.addCurve(to: CGPoint(x: 11.854, y: 11.854), control1: CGPoint(x: 12.003, y: 11.636), control2: CGPoint(x: 11.953, y: 11.754))
        p.addCurve(to: CGPoint(x: 11.5, y: 12.003), control1: CGPoint(x: 11.754, y: 11.953), control2: CGPoint(x: 11.636, y: 12.003))
        p.addCurve(to: CGPoint(x: 11.146, y: 11.854), control1: CGPoint(x: 11.364, y: 12.003), control2: CGPoint(x: 11.246, y: 11.953))
        p.addLine(to: CGPoint(x: 7.5, y: 8.207))
        p.addLine(to: CGPoint(x: 3.854, y: 11.854))
        p.addCurve(to: CGPoint(x: 3.5, y: 12), control1: CGPoint(x: 3.756, y: 11.951), control2: CGPoint(x: 3.638, y: 12))
        p.addCurve(to: CGPoint(x: 3.146, y: 11.854), control1: CGPoint(x: 3.362, y: 12), control2: CGPoint(x: 3.244, y: 11.951))
        p.addCurve(to: CGPoint(x: 2.997, y: 11.5), control1: CGPoint(x: 3.047, y: 11.754), control2: CGPoint(x: 2.997, y: 11.636))
        p.addCurve(to: CGPoint(x: 3.146, y: 11.146), control1: CGPoint(x: 2.997, y: 11.364), control2: CGPoint(x: 3.047, y: 11.246))
        p.addLine(to: CGPoint(x: 6.793, y: 7.5))
        p.addLine(to: CGPoint(x: 3.146, y: 3.854))
        p.addCurve(to: CGPoint(x: 2.997, y: 3.5), control1: CGPoint(x: 3.047, y: 3.754), control2: CGPoint(x: 2.997, y: 3.636))
        p.addCurve(to: CGPoint(x: 3.146, y: 3.146), control1: CGPoint(x: 2.997, y: 3.364), control2: CGPoint(x: 3.047, y: 3.246))
        p.addCurve(to: CGPoint(x: 3.5, y: 2.997), control1: CGPoint(x: 3.246, y: 3.047), control2: CGPoint(x: 3.364, y: 2.997))
        p.addCurve(to: CGPoint(x: 3.854, y: 3.146), control1: CGPoint(x: 3.636, y: 2.997), control2: CGPoint(x: 3.754, y: 3.047))
        p.addLine(to: CGPoint(x: 7.5, y: 6.793))
        p.addLine(to: CGPoint(x: 11.146, y: 3.146))
        p.addCurve(to: CGPoint(x: 11.5, y: 2.997), control1: CGPoint(x: 11.246, y: 3.047), control2: CGPoint(x: 11.364, y: 2.997))
        p.closeSubpath()
        return p.applying(CGAffineTransform(scaleX: rect.width / 16, y: rect.height / 16))
    }
}

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

### Compose

```kotlin
// Gentleface "x" (line-round), MIT. https://gentleface.com/icons/x
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 XIcon: ImageVector by lazy {
    ImageVector.Builder(
        name = "x", defaultWidth = 16.dp, defaultHeight = 16.dp,
        viewportWidth = 16f, viewportHeight = 16f,
    ).addPath(
        pathData = addPathNodes("M11.5 2.997C11.636 2.997 11.754 3.047 11.854 3.146C11.951 3.244 12 3.362 12 3.5C12 3.638 11.951 3.756 11.854 3.854L8.207 7.5L11.854 11.146C11.953 11.246 12.003 11.364 12.003 11.5C12.003 11.636 11.953 11.754 11.854 11.854C11.754 11.953 11.636 12.003 11.5 12.003C11.364 12.003 11.246 11.953 11.146 11.854L7.5 8.207L3.854 11.854C3.756 11.951 3.638 12 3.5 12C3.362 12 3.244 11.951 3.146 11.854C3.047 11.754 2.997 11.636 2.997 11.5C2.997 11.364 3.047 11.246 3.146 11.146L6.793 7.5L3.146 3.854C3.047 3.754 2.997 3.636 2.997 3.5C2.997 3.364 3.047 3.246 3.146 3.146C3.246 3.047 3.364 2.997 3.5 2.997C3.636 2.997 3.754 3.047 3.854 3.146L7.5 6.793L11.146 3.146C11.246 3.047 11.364 2.997 11.5 2.997Z"),
        fill = SolidColor(Color.Black),
    ).build()
}

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

### Android XML

```xml
<!-- res/drawable/ic_x.xml · Gentleface "x" (line-round), MIT. https://gentleface.com/icons/x -->
<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="M11.5 2.997C11.636 2.997 11.754 3.047 11.854 3.146C11.951 3.244 12 3.362 12 3.5C12 3.638 11.951 3.756 11.854 3.854L8.207 7.5L11.854 11.146C11.953 11.246 12.003 11.364 12.003 11.5C12.003 11.636 11.953 11.754 11.854 11.854C11.754 11.953 11.636 12.003 11.5 12.003C11.364 12.003 11.246 11.953 11.146 11.854L7.5 8.207L3.854 11.854C3.756 11.951 3.638 12 3.5 12C3.362 12 3.244 11.951 3.146 11.854C3.047 11.754 2.997 11.636 2.997 11.5C2.997 11.364 3.047 11.246 3.146 11.146L6.793 7.5L3.146 3.854C3.047 3.754 2.997 3.636 2.997 3.5C2.997 3.364 3.047 3.246 3.146 3.146C3.246 3.047 3.364 2.997 3.5 2.997C3.636 2.997 3.754 3.047 3.854 3.146L7.5 6.793L11.146 3.146C11.246 3.047 11.364 2.997 11.5 2.997Z"/>
</vector>
```

### Flutter

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

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

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

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

  @override
  void paint(Canvas canvas, Size size) {
    canvas.scale(size.width / 16, size.height / 16);
    final p = Path()
      ..moveTo(11.5, 2.997)
      ..cubicTo(11.636, 2.997, 11.754, 3.047, 11.854, 3.146)
      ..cubicTo(11.951, 3.244, 12, 3.362, 12, 3.5)
      ..cubicTo(12, 3.638, 11.951, 3.756, 11.854, 3.854)
      ..lineTo(8.207, 7.5)
      ..lineTo(11.854, 11.146)
      ..cubicTo(11.953, 11.246, 12.003, 11.364, 12.003, 11.5)
      ..cubicTo(12.003, 11.636, 11.953, 11.754, 11.854, 11.854)
      ..cubicTo(11.754, 11.953, 11.636, 12.003, 11.5, 12.003)
      ..cubicTo(11.364, 12.003, 11.246, 11.953, 11.146, 11.854)
      ..lineTo(7.5, 8.207)
      ..lineTo(3.854, 11.854)
      ..cubicTo(3.756, 11.951, 3.638, 12, 3.5, 12)
      ..cubicTo(3.362, 12, 3.244, 11.951, 3.146, 11.854)
      ..cubicTo(3.047, 11.754, 2.997, 11.636, 2.997, 11.5)
      ..cubicTo(2.997, 11.364, 3.047, 11.246, 3.146, 11.146)
      ..lineTo(6.793, 7.5)
      ..lineTo(3.146, 3.854)
      ..cubicTo(3.047, 3.754, 2.997, 3.636, 2.997, 3.5)
      ..cubicTo(2.997, 3.364, 3.047, 3.246, 3.146, 3.146)
      ..cubicTo(3.246, 3.047, 3.364, 2.997, 3.5, 2.997)
      ..cubicTo(3.636, 2.997, 3.754, 3.047, 3.854, 3.146)
      ..lineTo(7.5, 6.793)
      ..lineTo(11.146, 3.146)
      ..cubicTo(11.246, 3.047, 11.364, 2.997, 11.5, 2.997)
      ..close();
    canvas.drawPath(p, Paint()..color = color);
  }

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