Use this calculator when ng/µL alone does not answer the lab question. ng/µL reports mass per volume. nM reports molecule concentration. A 20 nt primer and a 350 bp sequencing library can share the same ng/µL value but contain very different numbers of molecules.
The conversion needs molecular weight. For quick estimates, many lab calculations use about 660 g/mol per base pair for dsDNA, about 330 g/mol per nucleotide for ssDNA, and about 340 g/mol per nucleotide for RNA. Exact molecular weight improves results for modified oligos, fluorophore-labelled probes, adapters, and vendor-supplied sequences.
Thermo Fisher provides nucleic-acid molecular-weight conversion tables for DNA and RNA, while IDT explains why oligo quantification often uses nmol for practical dilution and stock preparation. Review molecular-weight conversion tables.