---
tag: m0034
title: SDCard Sorting
brief: Set SDCard file sorting options.
author: thinkyhead
contrib: classicrocker883

group: sdcard
since: 1.1.0
requires: SDSUPPORT, SDCARD_SORT_ALPHA

codes: [ M34 ]

notes: Requires [`SDSUPPORT`](/docs/configuration/configuration.html#sd-card) and `SDCARD_SORT_ALPHA`.

parameters:

- tag: S
  optional: true
  description: Sorting Order
  values:
  - tag:
    description: Default sorting (i.e., SDSORT_REVERSE)
  - tag: -1
    description: Reverse alpha sorting
  - tag: 0
    description: FID Order (not always newest)
  - tag: 1
    description: Forward alpha sorting
  - tag: 2
    description: Alias for S-1 [deprecated]

- tag: F
  optional: true
  description: Folder Sorting
  values:
  - tag: -1
    description: Folders before files
  - tag: 0
    description: No folder sorting
  - tag: 1
    description: Folders after files

---

Marlin now contains support for SDCard alphabetical file sorting in the LCD menus. This feature uses free SRAM to create a sorting index for up to the first 256 files in the current folder, and (if you have _lots_ of SRAM) can optionally cache file listings for a more responsive UI. Buffering only occurs during file browsing. Otherwise the SRAM is freed.
