> ## Documentation Index
> Fetch the complete documentation index at: https://docs.linkx.tr/llms.txt
> Use this file to discover all available pages before exploring further.

# QR Code Styling: Shapes, Size & Format

> Customize QR code module shapes, eye styles, composite inner eyes, output size, margin, format, and character encoding using the Laravel QR Code package.

The Laravel QR Code package gives you fine-grained control over the visual appearance of every QR code you generate. You can change the shape of individual data modules, the look of the three positional eyes, output dimensions, surrounding margin, file format, and text encoding — all through a fluent chainable API.

## Module Style

The **module style** controls the shape of every small data block that makes up the body of the QR code. Pass a style string (or the `Style` enum) to `style()`.

| Value | Description |
| - | - |
| `square` | Sharp-cornered squares (default) |
| `dot` | Circular dots |
| `round` | Rounded squares |

```php theme={null}
use Linkxtr\QrCode\Facades\QrCode;

// Circular dot modules
QrCode::style('dot')->generate('https://example.com');

// Rounded-square modules
QrCode::style('round')->generate('https://example.com');

// Explicit square (same as default)
QrCode::style('square')->generate('https://example.com');
```

> [!TIP]
>
> The `style()` method accepts both a plain string (e.g. `'dot'`) and the
> `Linkxtr\QrCode\Enums\Style` enum case (e.g. `Style::DOT`). Both forms are
> equivalent.

![Square modules QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/style-square.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=b999916a98205428a1487cd478888216)

Square modules (default)

![Circular dot modules QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/style-dot.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=8afa73d4c600f6518e3c2a34dcbc2c1d)

Circular dot modules

![Rounded modules QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/style-round.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=7632277db17743644d731b201455d20c)

Rounded modules

## Eye Style

The three large **positional squares** in the corners of every QR code are called eyes. Use `eye()` to set their outer shape.

| Value | Description |
| - | - |
| `square` | Traditional sharp-cornered square (default) |
| `circle` | Fully rounded circle |
| `pointy` | Inward-pointed corners |

```php theme={null}
// Circle eyes with dot modules — a common modern look
QrCode::style('dot')->eye('circle')->generate('https://example.com');

// Pointy eyes with round modules
QrCode::style('round')->eye('pointy')->generate('https://example.com');
```

![Square eyes QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/eye-square.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=7bb2a4169b73ec37d1b33a437b7c5183)

Square eyes (default)

![Circle eyes QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/eye-circle.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=8e70db212b24c1931ece84b404ef5034)

Circle eyes

![Pointy eyes QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/eye-pointy.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=028d7edbbec421f803b0b2697b9e430b)

Pointy eyes

## Internal (Composite) Eye Style

Each positional eye is made of two parts: an outer frame and an inner marker. By default both share the same style set by `eye()`. Call `internalEye()` to style the **inner marker** independently, giving you composite eyes.

```php theme={null}
// Round outer eye, circle inner marker
QrCode::style('round')->eye('square')->internalEye('circle')->generate('https://example.com');

// Circle outer, pointy inner
QrCode::style('dot')->eye('circle')->internalEye('pointy')->generate('https://example.com');
```

> [!NOTE]
>
> `internalEye()` accepts the same values as `eye()`: `'square'`, `'circle'`,
> and `'pointy'`.

![Square outer with circle inner eye QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/internal-eye-square-circle.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=410df2e02c64649c9067fd0dd2958eda)

Square outer with circle inner

![Circle outer with pointy inner eye QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/internal-eye-circle-pointy.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=dadcc3a82e2bbf2d1bff6476a1a69a31)

Circle outer with pointy inner

## Size and Margin

Control the pixel dimensions and quiet zone around the code with `size()` and `margin()`.

```php theme={null}
// 300 × 300 px with a 2-module quiet zone
QrCode::size(300)->margin(2)->generate('https://example.com');

// Larger code with more breathing room
QrCode::size(500)->margin(6)->generate('https://example.com');
```

* **`size(int $size)`** — Total width and height in pixels. Default: `400`.
* **`margin(int $margin)`** — Quiet-zone thickness in modules. Default: `4`.

![Margin 0 QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/margin-0.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=f8612b157914e13216ec970d99361c29)

Margin 0 (no quiet zone)

![Margin 2 QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/margin-2.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=212e85df5a04acc30fc688064da6379a)

Margin 2 (compact quiet zone)

![Margin 6 QR code](https://mintcdn.com/laravel-qrcode/e1jio7idcPehW76b/images/styling/margin-6.svg?fit=max\&auto=format\&n=e1jio7idcPehW76b\&q=85\&s=c3ac070f702b0a2b85cfc10a66ad9b2b)

Margin 6 (wide quiet zone)

## Output Format

Use `format()` to choose the image format of the generated QR code.

| Value | Extension | PHP extension required |
| - | - | - |
| `svg` | `.svg` | None (default) |
| `png` | `.png` | `imagick` or `gd` |
| `webp` | `.webp` | `imagick` |
| `eps` | `.eps` | None |

```php theme={null}
// SVG (default — no extra extensions needed)
QrCode::format('svg')->generate('https://example.com');

// PNG raster image
QrCode::format('png')->generate('https://example.com');

// WebP (requires Imagick)
QrCode::format('webp')->generate('https://example.com');

// EPS vector
QrCode::format('eps')->generate('https://example.com');
```

> [!WARNING]
>
> When saving to a file, make sure the filename extension matches the chosen
> format. A mismatch (e.g. `qr.png` with `format('svg')`) will produce a file
> with incorrect content.

```php theme={null}
// Save a PNG to disk
QrCode::format('png')->generate('https://example.com', storage_path('app/qr.png'));
```

## Encoding

By default the package encodes text as **UTF-8**, which handles the vast majority of use cases. Override this with `encoding()` when your payload uses a different character set.

```php theme={null}
// Explicit UTF-8 (same as default)
QrCode::encoding('UTF-8')->generate('Hello, 世界');

// ISO-8859-1 for Western European characters
QrCode::encoding('ISO-8859-1')->generate('Héllo');
```

## Putting It All Together

Chain any combination of style options before calling `generate()`.

```php theme={null}
use Linkxtr\QrCode\Facades\QrCode;

$qr = QrCode::format('png')
    ->size(400)
    ->margin(2)
    ->style('dot')
    ->eye('circle')
    ->internalEye('square')
    ->encoding('UTF-8')
    ->generate('https://example.com');
```

> [card] [Colors](https://docs.linkx.tr/customization/colors.md)
>
> Apply RGB, CMYK, grayscale, gradients, and per-eye color overrides.

> [card] [Image Merge](https://docs.linkx.tr/customization/image-merge.md)
>
> Embed a logo or image into the center of your QR code.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.