We here describe the construction of a highly sensitive and selective all-solid-state phosphate electrode based on polyaniline and H3PO4 doped polyaniline. The polyaniline layer was electroplated on the gold substrate with Chronoamperometry method and was in-situ doped by H3PO4. The Scanning Electron Microscopy-Energy Dispersive X-ray Spectroscopy (SEM, EDS) and contact angle measurement was taken to explain the difference of the two layers. This electrode can be used in both freshwater and seawater systems. In both of the two systems, the electrode exhibits linear response in the concentration range 10 -1 to 10 -6 M with detection limit of 10 -6 M. and response time of <1 seconds. The selectivity of the electrodes was also studied in 10 -1 -10 -5 M KH2PO4 solutions containing either 0.01 M sulfate, nitrate, chloride as the interference ions. During 12 hours continuous monitoring in 10 -3