Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
TakeSmallest
  • See Also
    • TakeSmallestBy
    • MinimalBy
    • Min
    • PositionSmallest
    • Sort
    • SortBy
    • NumericalSort
    • NumericalOrder
    • Ordering
    • RankedMin
    • TakeLargest
    • TakeLargestBy
  • Related Guides
    • Knowledge Representation & Access
    • Computation with Structured Datasets
    • Math & Counting Operations on Lists
    • Descriptive Statistics
    • Robust Descriptive Statistics
    • See Also
      • TakeSmallestBy
      • MinimalBy
      • Min
      • PositionSmallest
      • Sort
      • SortBy
      • NumericalSort
      • NumericalOrder
      • Ordering
      • RankedMin
      • TakeLargest
      • TakeLargestBy
    • Related Guides
      • Knowledge Representation & Access
      • Computation with Structured Datasets
      • Math & Counting Operations on Lists
      • Descriptive Statistics
      • Robust Descriptive Statistics

TakeSmallest[data,n]

gives the n smallest elements of data, sorted in ascending order.

TakeSmallest[dataprop,n]

gives the property prop for the n smallest elements in data.

TakeSmallest[data,n,p]

uses the order function p for sorting.

TakeSmallest[n]

represents an operator form of TakeSmallest that can be applied to an expression.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Options  
ExcludedForms  
Applications  
Properties & Relations  
Possible Issues  
See Also
Related Guides
Related Links
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • TakeSmallestBy
    • MinimalBy
    • Min
    • PositionSmallest
    • Sort
    • SortBy
    • NumericalSort
    • NumericalOrder
    • Ordering
    • RankedMin
    • TakeLargest
    • TakeLargestBy
  • Related Guides
    • Knowledge Representation & Access
    • Computation with Structured Datasets
    • Math & Counting Operations on Lists
    • Descriptive Statistics
    • Robust Descriptive Statistics
    • See Also
      • TakeSmallestBy
      • MinimalBy
      • Min
      • PositionSmallest
      • Sort
      • SortBy
      • NumericalSort
      • NumericalOrder
      • Ordering
      • RankedMin
      • TakeLargest
      • TakeLargestBy
    • Related Guides
      • Knowledge Representation & Access
      • Computation with Structured Datasets
      • Math & Counting Operations on Lists
      • Descriptive Statistics
      • Robust Descriptive Statistics

TakeSmallest

TakeSmallest[data,n]

gives the n smallest elements of data, sorted in ascending order.

TakeSmallest[dataprop,n]

gives the property prop for the n smallest elements in data.

TakeSmallest[data,n,p]

uses the order function p for sorting.

TakeSmallest[n]

represents an operator form of TakeSmallest that can be applied to an expression.

Details and Options

  • TakeSmallest gives the smallest elements in the first level of the input data. »
  • By default, TakeSmallest uses NumericalOrder to sort numeric expressions, Quantity objects and DateObject expressions. For other types of objects, TakeSmallest sorts by canonical Order.
  • The data can have the following forms:
  • {e1,e2,…}list of values, including numbers, quantities, dates, ... » » »
    Association[…]association of values »
    QuantityArray[…]quantity array or other structured array »
    Tabular[…]type-consistent tabular data »
    TabularColumn[…]type-consistent column data »
    Dataset[…]general hierarchical data »
  • TakeSmallest[assoc,n] gives an association of length n by taking the n smallest values in assoc, preserving their keys.
  • In TakeSmallest[dataprop,n], possible forms for prop include:
  • "Element"gives each element itself »
    "Index"gives the index for each element »
    {prop1,prop2,…}a list of multiple forms »
    Allgives an association with element and index »
  • TakeSmallest[data,UpTo[n]] takes n smallest elements, or as many as are available. »
  • TakeSmallest[n][data] is equivalent to TakeSmallest[data,n].
  • TakeSmallest has option ExcludedForms. With the default setting ExcludedForms->Automatic, TakeSmallest drops elements that are None, Null or Indeterminate or have head Missing. »
  • The setting ExcludedForms->{patt1,patt2,…} specifies that expressions matching any of the patti should be excluded from results generated by TakeSmallest. »

Examples

open all close all

Basic Examples  (4)

Take the two smallest numbers in a list:

Do the same using the operator form of TakeSmallest:

Get the three smallest quantities in a list of Quantity objects:

Quantities can be present in multiple units:

Get the two least recent dates in a list of DateObject constructs:

Take the three smallest values in an association:

Scope  (9)

Take the four smallest numbers or as many as are available if fewer:

Quantities can be given as QuantityArray:

By default, Missing[] and several other symbolic expressions are excluded from the results:

Get the two smallest elements in a list:

Get the positions of the two smallest elements in a list:

Get the two smallest elements in a list along with their positions:

Get the two smallest elements in a list with their positions given first:

Get associations containing the element and position of the two smallest elements in a list:

Find the three smallest elements in a TabularColumn:

Get the four rows with the smallest element in the first column in a Tabular object:

Take a list of numeric expressions or infinities:

By default, TakeSmallest sorts the elements using NumericalOrder:

Use canonical Order instead:

Take a list of lists of integers:

They are not numeric elements, so they are sorted by default following canonical order:

Use instead lexicographic order, which will sort the list by their respective first elements:

Take a list of complex numbers:

Following NumericalOrder, TakeSmallest selects numbers with decreasing real part:

Options  (2)

ExcludedForms  (2)

By default, Missing[] and several other symbolic expressions are excluded from the results:

Specify which elements should be excluded:

By default, TakeSmallest takes all elements into account when finding the smallest ones:

Exclude particular elements:

Exclude elements matching a given pattern:

Applications  (6)

Get the three planets with the smallest radii:

Get the release dates of the five oldest James Bond movies:

Find the South American countries with the lowest life expectancy for their inhabitants:

Find the codons (groups of three consecutive nucleotides) with the lowest relative frequencies in the list of nucleotides of a gene:

Find the noble gases with the lowest boiling point and density:

Find the five least dense chemical elements:

Properties & Relations  (6)

TakeSmallest[list,n,p] is effectively equivalent to Take[Sort[list,p],n]:

TakeSmallest uses NumericalOrder as default ordering function p:

Using canonical order can give different results:

With numerical inputs, the result of TakeSmallest is determined by numerical comparisons:

Comparisons of non-numerical elements effectively follow canonical order:

Order is the default ordering function for Sort and ReverseSort:

TakeSmallest[data,…] operates at the first level of the input data:

If the input has several levels, it is still elements of the first level that will be sorted and extracted:

Unlike Min, TakeSmallest does not return values at deeper levels:

When different numerical expressions have the same value, their original order will be preserved:

TakeSmallest[list,n,p] is effectively equivalent to MinimalBy[list,Identity,n,p]:

Take a list of five dates in the current year:

Get the two earliest of the dates with TakeSmallest:

Get the second earliest of the dates with RankedMin:

Possible Issues  (2)

If fewer than the requested number of elements are present, TakeSmallest will not evaluate:

Use UpTo to get as many elements as possible:

If the elements are not comparable, TakeSmallest will not evaluate:

See Also

TakeSmallestBy  MinimalBy  Min  PositionSmallest  Sort  SortBy  NumericalSort  NumericalOrder  Ordering  RankedMin  TakeLargest  TakeLargestBy

Function Repository: DropSmallest  TakeSmaller  TakeBefore  ParetoListMinima

Related Guides

    ▪
  • Knowledge Representation & Access
  • ▪
  • Computation with Structured Datasets
  • ▪
  • Math & Counting Operations on Lists
  • ▪
  • Descriptive Statistics
  • ▪
  • Robust Descriptive Statistics

Related Links

  • An Elementary Introduction to the Wolfram Language : Parts of Lists

History

Introduced in 2015 (10.1) | Updated in 2019 (12.0) ▪ 2025 (14.2)

Wolfram Research (2015), TakeSmallest, Wolfram Language function, https://reference.wolfram.com/language/ref/TakeSmallest.html (updated 2025).

Text

Wolfram Research (2015), TakeSmallest, Wolfram Language function, https://reference.wolfram.com/language/ref/TakeSmallest.html (updated 2025).

CMS

Wolfram Language. 2015. "TakeSmallest." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/TakeSmallest.html.

APA

Wolfram Language. (2015). TakeSmallest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TakeSmallest.html

BibTeX

@misc{reference.wolfram_2025_takesmallest, author="Wolfram Research", title="{TakeSmallest}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/TakeSmallest.html}", note=[Accessed: 01-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_takesmallest, organization={Wolfram Research}, title={TakeSmallest}, year={2025}, url={https://reference.wolfram.com/language/ref/TakeSmallest.html}, note=[Accessed: 01-December-2025]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English