--- title: "Liquid filters: sort" description: Sorts the items in an array in case-sensitive alphabetical, or numerical, order. api_name: liquid source_url: html: https://shopify.dev/docs/api/liquid/filters/sort md: https://shopify.dev/docs/api/liquid/filters/sort.md --- # sort ```oobleck array | sort ``` Sorts the items in an array in case-sensitive alphabetical, or numerical, order. ```liquid {% assign tags = collection.all_tags | sort %} {% for tag in tags -%} {{ tag }} {%- endfor %} ``` ## Output ```html Burning Salty dried extra-potent extracts fresh healing ingredients music plant supplies ``` ### Sort by an array item property ```oobleck array | sort: string ``` You can specify an array item property to sort the array items by. You can sort by any property of the object that you're sorting. ```liquid {% assign products = collection.products | sort: 'price' %} {% for product in products -%} {{ product.title }} {%- endfor %} ``` ## Output ```html Charcoal Dandelion milk Forest mushroom Glacier ice Ground mandrake root Komodo dragon scale Love Potion Potion beats Potion bottle Dried chamomile Blue Mountain Flower Gift Card Health potion Mana potion Whole bloodroot Crocodile tears Invisibility potion Viper venom Draught of Immortality ```