---
title: MaxFileSize
description: Reports theme files that exceed Shopify's maximum file size.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/max-file-size
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/max-file-size.md
api_name: liquid
---

# Max​File​Size

Identifies theme files that are larger than Shopify's maximum file size for their path. This check applies to Liquid, JSON, and asset files in size-limited theme directories, and ignores files in the `_drafts` directory.

Asset file limits use the full UTF-8 byte size. For non-asset file limits, Theme Check doesn't count bytes inside `{% schema %}` tags toward the file-size limit.

***

## Examples

The following examples contain code snippets that either fail or pass this check.

### ✗ Fail

In the following example, `snippets/card.liquid` exceeds the 256 KB limit for the `snippets` directory. The markup is abbreviated here:

## snippets/card.liquid

```liquid
<article class="card">
  {{ product.title }}
  {% comment %} Repeated markup totaling more than 256 KB {% endcomment %}
</article>
```

### ✓ Pass

In the following example, an oversized JSON template is ignored because it's in the `_drafts` directory:

## \_drafts/templates/index.json

```json
{
  "sections": {
    "main": {
      "type": "main-product"
    }
  },
  "order": ["main"]
}
```

***

## Options

The following example contains the default configuration for this check:

```yaml
MaxFileSize:
  enabled: true
  severity: error
```

| Parameter | Description |
| - | - |
| `enabled` | Whether this check is enabled. |
| `severity` | The [severity](https://shopify.dev/docs/storefronts/themes/tools/theme-check/configuration#check-severity) of the check. |

The following file-size limits are enforced:

| File path | Limit |
| - | - |
| `assets` | 20 MB |
| `locales` | 1.5 MB |
| `config/settings_data.json` | 1.5 MB |
| `config/settings_schema.json` | 512 KB |
| `templates/*.json` | 512 KB |
| `sections/*.json` | 512 KB |
| `blocks` | 256 KB |
| `config` | 256 KB |
| `layout` | 256 KB |
| `snippets` | 256 KB |
| `templates` | 256 KB |
| `sections` | 256 KB |

***

## Disabling this check

Disabling this check isn't recommended.

***
