The desired control of particle size, doping element composition, and surface structure of carbon dots (CDs) are vital for understanding the fluorescence mechanism and exploring their potential applications. Herein, nitrogen-doped CDs (N-doped CDs) have been synthesized with tartaric acid and various alkylol amines (monoethanolamine, biethanolamine and triethanolamine) under microwave irradiation. A systematic investigation was performed to characterize the N-doped CDs. It is found that with increasing nitrogen proportion, the fluorescent quantum yield and lifetime of N-doped CDs increases, whereas cell toxicity decreases. In other words, N-doped CDs synthesized by tartaric acid and monoethanolamine have the highest nitrogen content, the highest fluorescent quantum yield, the longest lifetime and the lowest cell toxicity. A corresponding mechanism has been proposed. Moreover, as-synthesized N-doped CDs have been applied for selectively detecting the Fe(3+) ion and writing letters as a fluorescent ink.