The LaTeX command for complexity NP is \mathsf{NP} (NP complexity class).
\mathsf{NP}Writing a paper? The table generator and the BibTeX cleaner are one click away, no account.
Write \mathsf{NP} inside math mode, that is between $โฆ$ for inline math or in a \[ โฆ \] or equation block for display math. It is part of core LaTeX math, so no extra package is required.
In pseudocode or running text, wrap \mathsf{NP} in $...$ so it keeps math spacing and fonts.
Open this example in the live preview: it renders as you type, with no compiler and no signup.
\neg\mid\lfloor x \rfloor\lceil x \rceil\top\bot\models\mathsf{P}\mathcal{O}\Omega\Thetao\oplus\landComputer science symbols in LaTeX: the full table or search all 350+ LaTeX symbols.
Use \mathsf{NP} in math mode; it needs no extra package. For example, $\mathsf{NP}$.
None: \mathsf{NP} is built into LaTeX, so no extra package is required.