Alkaline phosphatase (ALP)-catalyzed hydrogelation has been extensively explored and found wide applications. Spectroscopic and electrochemical approaches are commonly employed for the detection of ALP activity. Herein, by rational design of a fluorescence probe Fmoc-K(FITC)FFYp (P1) (where FITC is fluorescein), we incorporated sol-gel transition with fluorescence "turn-off" and developed a new method for quantitative sensing ALP activity in vitro and in living cells. Under the catalysis of ALP, P1 was converted to hydrogelator Fmoc-K(FITC)FFY (1) which self-assembles into nanofibers to form Gel I. Accompanying this sol-gel transition, the fluorescence emission of P1 was turned off. Our assay was employed to detect ALP activity over the range of 0-2.8 U/mL with a limit of detection (LOD) of 0.06 U/mL. ALP-inhibitor-treated cell imaging indicated that P1 could be applied for sensing ALP activity in living cells. Our method provides a new option for real time and quantitative sensing ALP activity in vitro and even in living cells.