Lloyd Nolan, 83, a veteran screen actor esteemed for the quiet skill with which he portrayed both good guys and bad in dozens of Hollywood melodramas, and who also made a mark on Broadway, died yesterday at his home in Los Angeles. He had lung cancer.

Known to critics for the practiced professionalism that he brought to low-budget movies, Mr. Nolan appeared regularly on the screen from the 1930s through the 1960s in westerns, war pictures, and gangster and detective films.

Little of his film work brought him the degree of acclaim he won in the 1953-54 Broadway theater season when he played Lt. Cmdr. Philip Queeg in the "Caine Mutiny Court-Martial," a dramatization of Herman Wouk's novel about a rebellion aboard a Navy minesweeper during World War II.

After appearing initially as the rigid, aloof, arrogantly confident ship's captain whose subordinates had mutinied, Mr. Nolan stunned audiences and critics as he deteriorated psychologically under cross-examination. Exposing the soul of a troubled, tortured man, he aroused sympathy and pathos.

New York's drama critics named him the best actor of the year. In addition, his 1956 performance as Queeg in a television version of the play won him an Emmy award.

Comfortable in both the good guy's white hat and the villain's black, Mr. Nolan was frequently seen in the snap-brim fedora of the 1930s and 1940s detective. His knowing air and nasality of tone seemed particularly suited to the roles as law enforcer.

Although he reminded some of a streetwise New Yorker, an impression enhanced by his widely remembered performance as a policeman in "A Tree Grows in Brooklyn," Mr. Nolan was the son of a San Francisco shoe manufacturer and spent three years at Stanford University before yielding to the lure of the stage.

Mr. Nolan, who had been active in dramatics in both college and prep school, made his first professional appearances in Pasadena Playhouse productions of Ibsen and Shakespeare. He reached Broadway in 1929 in a musical comedy chorus. In 1934, after several years of acting a variety of parts, he left for Hollywood, under contract to Paramount Pictures.

Among the films for which he was known are "Bataan" (1943) and "Guadalcanal Diary" (1943), "Lady in the Lake" (1947), "Green Grass of Wyoming" (1948) and "The Lemon Drop Kid" (1951).

Probably his best known law-and-order role was in "The House on 92nd Street" (1946), a spy drama done in documentary style, in which he played an FBI inspector.

His other films included "Peyton Place," "Airport" and "Earthquake."

Mr. Nolan was a television pioneer, playing the leading role in "Martin Kane, Private Eye," a series that premiered in 1951.

In addition to numerous TV guest appearances, Mr. Nolan costarred from 1968 to 1971 with Diahann Carroll in "Julia," a comedy series about a nurse struggling to readjust to life after her husband's death in Vietnam. Mr. Nolan played Julia's employer, Dr. Morton Chegley.

He was married in 1933 to Mell Efird, whom he met while they were acting together in "Sweet Stranger." He said they both appeared in the first and third acts, giving them the second to become acquainted.

Miss Efird died in 1981, and Mr. Nolan remarried in 1983. Survivors include his second wife, a daughter and two grandchildren.

A son, who was autistic, died in 1969, and much of Mr. Nolan's subsequent earnings went to establish the Jay Nolan Autistic Center in California.