An optical sensor, comprising: a semiconductive layer comprising an electrical circuit area and an optical sensing area, wherein the optical sensing area includes a light-sensing region, wherein the semiconductive layer further comprises a horizontal upper surface; a sample-holding portion over the light-sensing region; a light-guiding structure between the sample-holding portion and the optical sensing area; and an electrical interconnect structure disposed above the electrical circuit area, wherein the electrical interconnect structure comprises at least one electrical contact over the electrical circuit area, and the electrical contact extends from the horizontal upper surface of the semiconductive layer; a metal layer disposed between the sample-holding portion and the light-guiding structure, wherein an opening of the metal layer exposes the light sensing region for receiving the light from the sample-holding portion via the light-guiding structure, while the metal layer covers the other regions of the semiconductive layer; a waveguide structure disposed over the electrical circuit area and the optical sensing area, wherein the waveguide structure covers the metal layer, the waveguide structure comprising: a lower cladding layer; a core layer over the lower cladding layer; and an upper cladding layer over the core layer, wherein the sample-holding portion is disposed in the upper cladding layer, wherein the refractive index of the core layer is higher than that of the lower cladding layer and the upper cladding layer; characterized in that the light-guiding structure comprises at least one light-guiding spacer extending from the horizontal upper surface of the semiconductive layer toward a bottom surface of the metal layer, the light-guiding structure having a smooth inner sidewall to prevent light scattering, and the light-guiding structure has a tapering top end pointed to a sidewall of the metal layer that defines the opening. a semiconductive layer comprising an electrical circuit area and an optical sensing area, wherein the optical sensing area includes a light-sensing region, wherein the semiconductive layer further comprises a horizontal upper surface; a sample-holding portion over the light-sensing region; a light-guiding structure between the sample-holding portion and the optical sensing area; and an electrical interconnect structure disposed above the electrical circuit area, wherein the electrical interconnect structure comprises at least one electrical contact over the electrical circuit area, and the electrical contact extends from the horizontal upper surface of the semiconductive layer; a metal layer disposed between the sample-holding portion and the light-guiding structure, wherein an opening of the metal layer exposes the light sensing region for receiving the light from the sample-holding portion via the light-guiding structure, while the metal layer covers the other regions of the semiconductive layer; a waveguide structure disposed over the electrical circuit area and the optical sensing area, wherein the waveguide structure covers the metal layer, the waveguide structure comprising: a lower cladding layer; a core layer over the lower cladding layer; and a lower cladding layer; a core layer over the lower cladding layer; and an upper cladding layer over the core layer, wherein the sample-holding portion is disposed in the upper cladding layer, wherein the refractive index of the core layer is higher than that of the lower cladding layer and the upper cladding layer; characterized in that the light-guiding structure comprises at least one light-guiding spacer extending from the horizontal upper surface of the semiconductive layer toward a bottom surface of the metal layer, the light-guiding structure having a smooth inner sidewall to prevent light scattering, and the light-guiding structure has a tapering top end pointed to a sidewall of the metal layer that defines the opening.