# manifest.json

> The `manifest.json` file is a JSON file that defines metadata for a web app, including its name, icons and theme colors, for a better user experience.

## What should a web app manifest (manifest.json) contain?

The JSON file, also called the web app manifest, that describes an app's name, icons, colors and start URL. Linked with `<link rel='manifest'>`, it lets browsers install the site as an app on desktop and mobile.

- Topic: Web Application
- Type: file

## Example

Wrong:

```json
{
  "name": "My App",
  "icons": [{ "src": "/icon.png", "sizes": "64x64" }]
}
```

Right:

```json
{
  "name": "My App",
  "short_name": "App",
  "start_url": "/",
  "display": "standalone",
  "icons": [
    { "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
    { "src": "/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
  ]
}
```

Install needs a name, start URL, display mode and large icons, and a single small icon is not enough.

## Common mistakes

- Icon paths that return 404, so the browser does not offer to install the app.

## Key points

- Every page links the manifest with `<link rel='manifest'>`.
- It has `name`, `short_name`, `start_url`, `display` and `icons`.
- Icons include 192px and 512px PNGs, plus a 'maskable' icon for adaptive shapes.
- `theme_color` matches the `<meta name='theme-color'>` tag.

## Interview questions

### Should the file be named manifest.json or manifest.webmanifest?

Either works. The spec suggests '.webmanifest' with the 'application/manifest+json' type, but browsers accept any file linked from `<link rel='manifest'>`.

### What does `display: 'standalone'` do?

It opens the installed app in its own window without the browser address bar and tabs.

### What is a maskable icon?

An icon with its key content inside a safe zone, so the OS can crop it into a circle or other shape without cutting anything off.

## Related cards

- [PWA](https://wonderium.dev/web/pwa.md)
- [`<link>`](https://wonderium.dev/html/link.md)
- [`<meta>`](https://wonderium.dev/html/meta.md)
- [navigator.serviceWorker](https://wonderium.dev/js/navigator-service-worker.md)
- [.json](https://wonderium.dev/engineering/json.md)

---

- Level: [Web Platform](https://wonderium.dev/web.md)
- HTML version: https://wonderium.dev/web/manifest-json
- Last updated: 2026-11-25
